diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 13:21:17 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 13:21:17 +0000 |
commit | fe8fb574c06156ca7eef7367c85bd12991948806 (patch) | |
tree | 3bf529a0798e2e6f8f08d4a009bf2ae732d5c57b /activerecord/test/mixin_test.rb | |
parent | 45ea2bd4528aab5394cb5c94528f5b2c001ed518 (diff) | |
download | rails-fe8fb574c06156ca7eef7367c85bd12991948806.tar.gz rails-fe8fb574c06156ca7eef7367c85bd12991948806.tar.bz2 rails-fe8fb574c06156ca7eef7367c85bd12991948806.zip |
Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards, it'll take one less SELECT query if you use length.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/mixin_test.rb')
0 files changed, 0 insertions, 0 deletions