aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-16 18:28:03 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-16 18:28:03 -0200
commitc069e0fa342c914901d23b6e9201f1bef168278b (patch)
treefaaaa42a2ce98d5ec2c902c77b344eaf17a34c55 /activerecord/test
parent17a0b733fd976d826dfd023992e2f082c4deb136 (diff)
parent02ca5580bd5f70dbd5ffcd147da6b99e2c90c265 (diff)
downloadrails-c069e0fa342c914901d23b6e9201f1bef168278b.tar.gz
rails-c069e0fa342c914901d23b6e9201f1bef168278b.tar.bz2
rails-c069e0fa342c914901d23b6e9201f1bef168278b.zip
Merge pull request #12918 from versioncontrol/rails-12866
Checks to see if the record contains the foreign_key to set the inverse automatically Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test')
-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 dfc8a68e8c..b11d27467b 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -460,6 +460,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal ['id'], posts(:welcome).comments.select(:id).first.attributes.keys
end
+ def test_select_without_foreign_key
+ assert_equal companies(:first_firm).accounts.first.credit_limit, companies(:first_firm).accounts.select(:credit_limit).first.credit_limit
+ end
+
def test_adding
force_signal37_to_load_all_clients_of_firm
natural = Client.new("name" => "Natural Company")