diff options
author | Michał Łomnicki <michal.lomnicki@gmail.com> | 2010-12-12 01:37:56 +0100 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-23 15:19:17 -0800 |
commit | 030480ac1f4fbf8bf74a0d9298544426caf26894 (patch) | |
tree | ffbd1e3614e50ce045b0d095f3ed49b3751f3adf /activerecord/test/cases | |
parent | 85683f2a79dbf81130361cb6426786cf6b0d1925 (diff) | |
download | rails-030480ac1f4fbf8bf74a0d9298544426caf26894.tar.gz rails-030480ac1f4fbf8bf74a0d9298544426caf26894.tar.bz2 rails-030480ac1f4fbf8bf74a0d9298544426caf26894.zip |
Fix behaviour of foo.has_many_through_association.select('custom select') [#6089 state:resolved]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index d237273464..6b71e73718 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -514,4 +514,9 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase assert_equal [posts(:eager_other)], posts end + + def test_select_chosen_fields_only + author = authors(:david) + assert_equal ['body'], author.comments.select('comments.body').first.attributes.keys + end end |