Skip to content

Why is get_raw_records called three times? #367

@kunzig940

Description

@kunzig940

When debugging, get_raw_records is called three times. How can I bypass such behavior? For example the logs show:

  def get_raw_records
    puts "Raw Records"
    User.all
  end

Logs:

Raw Records
   (0.7ms)  SELECT COUNT(*) FROM "users"
Raw Records
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "users"
Raw Records
  User Load (0.5ms)  SELECT  "users".* FROM "users" ORDER BY users.first_name ASC LIMIT $1 OFFSET $2  [["LIMIT", 75], ["OFFSET", 0]]

If I return zero User records (i.e. User.none) it is only called twice so I'm assuming it's something to do with sorting/filtering in the background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions