diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-02-29 23:16:53 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-02-29 23:16:53 +0000 |
commit | 13a60b83a470fb90f91a073b0540f7b02aa11ebd (patch) | |
tree | 4bc3008ab6fd9ed5066b12d8ece47c1aa4f70db0 /activerecord/test | |
parent | 7dcd0d7d967c613f4e447ba6330e1f616b93c1a3 (diff) | |
download | rails-13a60b83a470fb90f91a073b0540f7b02aa11ebd.tar.gz rails-13a60b83a470fb90f91a073b0540f7b02aa11ebd.tar.bz2 rails-13a60b83a470fb90f91a073b0540f7b02aa11ebd.zip |
Improve performance by avoiding named block arguments. Closes #11109 [adymo]
Reapplies [8865] with some fixes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8957 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index e128d6dda3..c24a94bfc4 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -290,6 +290,11 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase assert_equal nil, authors(:david).categories.find_by_name('Technology') end + def test_has_many_array_methods_called_by_method_missing + assert true, authors(:david).categories.any? { |category| category.name == 'General' } + assert_nothing_raised { authors(:david).categories.sort } + end + def test_has_many_going_through_join_model_with_custom_foreign_key assert_equal [], posts(:thinking).authors assert_equal [authors(:mary)], posts(:authorless).authors |