aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
authorgregolsen <anotheroneman@yahoo.com>2012-01-31 11:48:26 +0200
committergregolsen <anotheroneman@yahoo.com>2012-01-31 11:52:23 +0200
commitf13a1dd781d57128cd53a9b070248b8bc13edaeb (patch)
tree93a806aa2b01a5a514fecb0e87291bb37fd49cab /activerecord/test/cases/associations/has_many_associations_test.rb
parent920030b3d58b0fa1e5600e9573d82d561f22aff1 (diff)
downloadrails-f13a1dd781d57128cd53a9b070248b8bc13edaeb.tar.gz
rails-f13a1dd781d57128cd53a9b070248b8bc13edaeb.tar.bz2
rails-f13a1dd781d57128cd53a9b070248b8bc13edaeb.zip
ids_reader method fixed, test added to has_many association
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index f1a341437f..b1b0768aab 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1253,6 +1253,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert company.clients_using_sql.loaded?
end
+ def test_get_ids_for_ordered_association
+ assert_equal [companies(:second_client).id, companies(:first_client).id], companies(:first_firm).clients_ordered_by_rating_ids
+ end
+
def test_assign_ids_ignoring_blanks
firm = Firm.create!(:name => 'Apple')
firm.client_ids = [companies(:first_client).id, nil, companies(:second_client).id, '']