1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record
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
..
associations Eager autoload JoinDependency 2021-12-13 16:43:35 -08:00
attribute_methods Check for default function before attribute changes for partial inserts 2021-10-26 18:25:21 +02:00
coders
connection_adapters Fix argument error on execute of the abstract_mysql_adapter 2022-01-05 18:43:16 +00:00
database_configurations Squashed commit of the following: 2021-12-03 04:02:40 +00:00
encryption Move ExtendedDeterministicQueries rdoc to correct namespace [ci-skip] 2022-01-04 17:11:20 +01:00
fixture_set Use reflection_class in TableRow for fixtures 2021-11-25 17:44:14 -03:00
locale
locking Accept optional transaction args to #with_lock 2021-09-23 09:43:00 -04:00
middleware Remove unnecessary require 2021-11-18 12:20:17 -05:00
migration Merge PR #43295 2021-12-21 07:28:39 +00:00
railties Remove deprecated rake tasks: 2021-11-19 21:43:14 +00:00
relation QueryMethods#in_order_of drop records not listed 2022-01-06 12:54:41 -05:00
scoping Merge branch 'main' into remove_scope_overwrite_warning 2021-09-14 19:57:23 -07:00
tasks Merge pull request #43988 from himanshugoyal-git/fix-migrations-order 2022-01-05 08:34:04 -05:00
type Remove unused code 2021-12-20 00:19:11 +08:00
type_caster
validations Fixed guide to case_sensitive option for Activerecord uniqueness validator [skip ci] 2021-09-23 00:20:39 +09:00
aggregations.rb
association_relation.rb
associations.rb Update association callback docs 2022-01-03 17:29:03 -08:00
asynchronous_queries_tracker.rb Call Executor#wrap around each test 2021-10-28 15:18:29 +02:00
attribute_assignment.rb
attribute_methods.rb Deprecate to_s(format) in favor of to_formatted_s(format) 2021-12-06 19:22:05 +00:00
attributes.rb
autosave_association.rb Make inversed association stale after updating id 2021-10-13 15:52:05 -04:00
base.rb Add authenticate_by when using has_secure_password 2021-12-03 10:06:43 -06:00
callbacks.rb
connection_adapters.rb
connection_handling.rb Merge pull request #43674 from Shopify/activerecord-isolated-state 2021-11-22 09:51:03 +01:00
core.rb ActiveRecord::Core: improve find by cache hit rate 2021-12-23 07:19:58 -05:00
counter_cache.rb
database_configurations.rb activerecord: add missing require statements 2021-11-22 17:08:27 -03:00
delegated_type.rb Add accepts_nested_attributes_for support when using delegated_type (#41717) 2021-11-03 14:10:55 +01:00
destroy_association_async_job.rb
disable_joins_association_relation.rb
dynamic_matchers.rb
encryption.rb
enum.rb Add tests for enum with strings 2021-10-25 13:34:28 -04:00
errors.rb Remove message from ActiveRecord::Rollback example 2021-10-05 16:02:28 +02:00
explain.rb
explain_registry.rb Eliminate internal uses of PerThreadRegistry and deprecate it 2021-11-22 09:53:16 +01:00
explain_subscriber.rb
fixtures.rb Use to_formatted_s(:db) instead of to_s(:db) internally 2021-12-06 19:22:04 +00:00
future_result.rb Use Process.clock_gettime unit argument to save some floating point multiplications 2021-10-21 10:05:32 +02:00
gem_version.rb Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
inheritance.rb Delete AS::Dependencies.safe_constantize 2021-08-20 17:51:05 +02:00
insert_all.rb Add support for passing the list of columns to update in upsert_all 2021-11-24 14:33:45 -08:00
integration.rb Allow default_timezone to vary between databases 2021-12-13 13:35:25 +10:30
internal_metadata.rb Set record_timestamps = true in AR::InternalMetadata 2021-08-11 10:05:07 +02:00
legacy_yaml_adapter.rb Remove deprecated support to YAML load ActiveRecord::Base instance in the Rails 4.2 and 4.1 formats 2021-11-17 21:51:35 +00:00
log_subscriber.rb Filter attributes in SQL logs 2021-08-19 14:16:13 -05:00
migration.rb Revert "Merge pull request #43604 from nikonoid/bug/31722" 2021-12-20 21:29:17 +00:00
model_schema.rb Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
nested_attributes.rb Update docs for nested_attributes to reflect default belongs_to behavior 2021-09-30 21:14:47 -05:00
no_touching.rb Use IsolatedExecutionState across Active Record 2021-11-19 11:54:11 +01:00
null_relation.rb
persistence.rb Fix upsert_all option typo 2021-12-02 19:18:49 +09:00
query_cache.rb
query_logs.rb Extract ActiveSupport::ExecutionContext out of ActiveRecord::QueryLogs 2021-11-10 09:36:02 +01:00
querying.rb
railtie.rb Add automatic shard swapping middleware 2021-11-18 08:18:45 -05:00
readonly_attributes.rb
reflection.rb Merge PR #43389 2021-12-20 22:47:24 +00:00
relation.rb Avoid eager loading in Relation#pretty_print 2022-01-07 17:29:17 +01:00
result.rb Remove deprecated ActiveRecord::Result#map! and ActiveRecord::Result#collect! 2021-11-19 23:16:25 +00:00
runtime_registry.rb Eliminate internal uses of PerThreadRegistry and deprecate it 2021-11-22 09:53:16 +01:00
sanitization.rb
schema.rb
schema_dumper.rb Merge PR #41487 2021-09-22 18:43:16 -04:00
schema_migration.rb Don't use schema cache when checking schema migrations 2021-12-15 10:53:58 -05:00
scoping.rb Eliminate internal uses of PerThreadRegistry and deprecate it 2021-11-22 09:53:16 +01:00
secure_password.rb Refine authenticate_by security guarantee [ci-skip] 2021-12-25 17:00:05 -06:00
secure_token.rb
serialization.rb
signed_id.rb
statement_cache.rb
store.rb
suppressor.rb Eliminate internal uses of PerThreadRegistry and deprecate it 2021-11-22 09:53:16 +01:00
table_metadata.rb
test_databases.rb
test_fixtures.rb
timestamp.rb Allow default_timezone to vary between databases 2021-12-13 13:35:25 +10:30
touch_later.rb
transactions.rb
translation.rb
type.rb
type_caster.rb
validations.rb
version.rb