"david" made AR/Oracle cry... http://dev.rubyonrails.org/changeset/5676 ------------------------------------------------------------------------ r5676 | david | 2006-12-04 19:26:56 -0800 (Mon, 04 Dec 2006) | 1 line Added counter optimization for AssociationCollection#any? so person.friends.any? won''t actually load the full association if we have the count in a cheaper form [DHH] ------------------------------------------------------------------------ U activerecord/test/associations_test.rb U activerecord/lib/active_record/associations/association_collection.rb U activerecord/CHANGELOG Updated to revision 5676. 1) Failure: test_has_many_find_readonly(ReadOnlyTest) [./test/readonly_test.rb:63]: <false> is not true. 1004 tests, 3862 assertions, 1 failures, 0 errors rake aborted! Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] (See full trace by running task with --trace) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
David, The #any? definition added doesn''t handle the common case of a block passed, it just implements the opposite of empty. Hence the breakage. Could go w/ something like: def any?(&block) if block_given? load_target.any?(&block) else !empty? end end Michael Schoen wrote:> "david" made AR/Oracle cry... > > http://dev.rubyonrails.org/changeset/5676 > ------------------------------------------------------------------------ > r5676 | david | 2006-12-04 19:26:56 -0800 (Mon, 04 Dec 2006) | 1 line > > Added counter optimization for AssociationCollection#any? so person.friends.any? won''t actually load the full association if we have the count in a cheaper form [DHH] > ------------------------------------------------------------------------ > > U activerecord/test/associations_test.rb > U activerecord/lib/active_record/associations/association_collection.rb > U activerecord/CHANGELOG > Updated to revision 5676. > > 1) Failure: > test_has_many_find_readonly(ReadOnlyTest) [./test/readonly_test.rb:63]: > <false> is not true.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---