rails--rails/activerecord/lib
Ulysse Buonomo 546de0f6c6 Avoid eager loading in Relation#pretty_print
We mimic the behaviour used with `#inspect`, only fetching up to 11
elements if records are not loaded already.

Here's the reproduction:

```
require "activerecord"

ActiveRecord::Base.establish_connection YOUR_DB_URL_THERE

ActiveRecord::Migration.new.tap do |m|
  m.create_table :foos do |t|
    t.text :name
  end
end

class Foo < ActiveRecord::Base
end

100.times { Foo.create(name: "foo#{_1}") }

pp Foo.all # loads the whole table.
```

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>
2022-01-07 17:29:17 +01:00
..
active_record Avoid eager loading in Relation#pretty_print 2022-01-07 17:29:17 +01:00
arel Use nested queries when doing DELETE and GROUP_BY and HAVINAG clauses present. 2021-11-01 21:39:20 -04:00
rails/generators Move multi-db config options to middleware 2021-12-08 13:01:04 -05:00
active_record.rb Bump license years to 2022 [ci-skip] 2022-01-01 15:22:15 +09:00
arel.rb Merge PR #40491 2021-10-14 20:46:08 +00:00