aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-01-31 05:47:41 -0800
committerJon Leighton <j@jonathanleighton.com>2012-01-31 13:51:09 +0000
commit85c724d59e46953c52fb457411597fbab90f3a4a (patch)
tree6eb192cd6a604f3e34274fe6a607354c2b71f60e /activerecord/test/cases/associations/has_many_associations_test.rb
parent7beb5a71f39f08c2b41a8f9b39f64e126d72bd79 (diff)
downloadrails-85c724d59e46953c52fb457411597fbab90f3a4a.tar.gz
rails-85c724d59e46953c52fb457411597fbab90f3a4a.tar.bz2
rails-85c724d59e46953c52fb457411597fbab90f3a4a.zip
Merge pull request #4783 from gregolsen/ids_reader_fix
ids_reader method fixed, test added to has_many association (for PostgreSQL)
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, '']