diff options
author | Arthur Neves <arthurnn@gmail.com> | 2013-09-25 14:24:27 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2013-09-25 14:24:27 -0400 |
commit | 3af4ae82e587b12664626e7b22bc6cc21ebbca2e (patch) | |
tree | f7e4203c27956fc9cd3917ea78cad9412504a59b /activerecord/test/cases/associations | |
parent | f3982858359008ec8fe43b8fa2c75aad8788cd89 (diff) | |
download | rails-3af4ae82e587b12664626e7b22bc6cc21ebbca2e.tar.gz rails-3af4ae82e587b12664626e7b22bc6cc21ebbca2e.tar.bz2 rails-3af4ae82e587b12664626e7b22bc6cc21ebbca2e.zip |
Make sure inverse_of is visible on the has_many callbacks
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 7 |
1 files changed, 7 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 ebeead0dc2..fd9b129ed4 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -518,6 +518,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end end + def test_inverse_on_before_validate + firm = companies(:first_firm) + assert_queries(1) do + firm.clients_of_firm << Client.new("name" => "Natural Company") + end + end + def test_new_aliased_to_build company = companies(:first_firm) new_client = assert_no_queries { company.clients_of_firm.new("name" => "Another Client") } |