aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/join_model_test.rb
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2014-10-27 17:28:53 +0100
committerErik Michaels-Ober <sferik@gmail.com>2014-11-29 11:53:24 +0100
commitd1374f99bf3090f3e659687c112ed0c5c0865cfb (patch)
treee87455ea620155254511180cc1f08c5544ed195c /activerecord/test/cases/associations/join_model_test.rb
parent56e47cf66d2e3009b4032d0cd2ceb1a6e5e42573 (diff)
downloadrails-d1374f99bf3090f3e659687c112ed0c5c0865cfb.tar.gz
rails-d1374f99bf3090f3e659687c112ed0c5c0865cfb.tar.bz2
rails-d1374f99bf3090f3e659687c112ed0c5c0865cfb.zip
Pass symbol as an argument instead of a block
Diffstat (limited to 'activerecord/test/cases/associations/join_model_test.rb')
-rw-r--r--activerecord/test/cases/associations/join_model_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb
index cace7ba142..140ccdac72 100644
--- a/activerecord/test/cases/associations/join_model_test.rb
+++ b/activerecord/test/cases/associations/join_model_test.rb
@@ -393,18 +393,18 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_has_many_through_polymorphic_has_one
- assert_equal Tagging.find(1,2).sort_by { |t| t.id }, authors(:david).taggings_2
+ assert_equal Tagging.find(1,2).sort_by(&:id), authors(:david).taggings_2
end
def test_has_many_through_polymorphic_has_many
- assert_equal taggings(:welcome_general, :thinking_general), authors(:david).taggings.distinct.sort_by { |t| t.id }
+ assert_equal taggings(:welcome_general, :thinking_general), authors(:david).taggings.distinct.sort_by(&:id)
end
def test_include_has_many_through_polymorphic_has_many
author = Author.includes(:taggings).find authors(:david).id
expected_taggings = taggings(:welcome_general, :thinking_general)
assert_no_queries do
- assert_equal expected_taggings, author.taggings.distinct.sort_by { |t| t.id }
+ assert_equal expected_taggings, author.taggings.distinct.sort_by(&:id)
end
end