diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-18 07:50:11 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-18 07:50:11 -0300 |
commit | 79e951ca9bc875da9e4a19adeff3634f0b5b7b76 (patch) | |
tree | 3b46a3061cea3bc6a1d7a72d9e6f5c793a56663b /activerecord/test/cases/associations | |
parent | c923409630a92d1a935699c1427702c822601165 (diff) | |
download | rails-79e951ca9bc875da9e4a19adeff3634f0b5b7b76.tar.gz rails-79e951ca9bc875da9e4a19adeff3634f0b5b7b76.tar.bz2 rails-79e951ca9bc875da9e4a19adeff3634f0b5b7b76.zip |
Use finder options as relation method names to provide more familiar
naming. Use bang methods convention in methods that alter the
relation.
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 811ebfbe3f..d5a4d9007b 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -301,13 +301,13 @@ class EagerAssociationTest < ActiveRecord::TestCase subscriber =Subscriber.find(subscribers(:second).id, :include => :subscriptions) assert_equal subscriptions, subscriber.subscriptions.sort_by(&:id) end - + def test_eager_load_has_many_through_with_string_keys books = books(:awdr, :rfr) subscriber = Subscriber.find(subscribers(:second).id, :include => :books) assert_equal books, subscriber.books.sort_by(&:id) end - + def test_eager_load_belongs_to_with_string_keys subscriber = subscribers(:second) subscription = Subscription.find(subscriptions(:webster_awdr).id, :include => :subscriber) @@ -434,7 +434,7 @@ class EagerAssociationTest < ActiveRecord::TestCase author_posts_without_comments = author.posts.select { |post| post.comments.blank? } assert_equal author_posts_without_comments.size, author.posts.count(:all, :include => :comments, :conditions => 'comments.id is null') end - + def test_eager_count_performed_on_a_has_many_through_association_with_multi_table_conditional person = people(:michael) person_posts_without_comments = person.posts.select { |post| post.comments.blank? } @@ -823,7 +823,7 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_equal expected, firm.clients_using_primary_key end end - + def test_preload_has_one_using_primary_key expected = Firm.find(:first).account_using_primary_key firm = Firm.find :first, :include => :account_using_primary_key @@ -839,5 +839,5 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_equal expected, firm.account_using_primary_key end end - + end |