diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-07 14:52:09 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-07 14:56:30 +0100 |
commit | d8ca791f48ea096d0e19bdc0ef1d021764a79f20 (patch) | |
tree | 93671ec03299313d3c81e3a2c119ad171e769a4d /activerecord/lib/active_record/relation/delegation.rb | |
parent | d4f59783d22d573a2ebbd4fc66024efbb122ba98 (diff) | |
download | rails-d8ca791f48ea096d0e19bdc0ef1d021764a79f20.tar.gz rails-d8ca791f48ea096d0e19bdc0ef1d021764a79f20.tar.bz2 rails-d8ca791f48ea096d0e19bdc0ef1d021764a79f20.zip |
Load all records in Relation#inspect
A test was failing due to the way that Relation#inspect causes
association proxies to ignore unsaved records added to the association.
This is fixed by simply calling to_a and letting to_a figure out how to
get the records (which, in the case of associations, takes into account
new records).
I think it is acceptable to do this rather than limiting the query at
the database level:
* It's what we've done in all released Rails versions up to this point
* The goal of the limit is to not flood the console with output - this
is the problem we're targeting, rather than the actual loading of the
records from the database
* You probably want to do something with those records later anyway,
otherwise you wouldn't have built a relation for them.
Diffstat (limited to 'activerecord/lib/active_record/relation/delegation.rb')
0 files changed, 0 insertions, 0 deletions