aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/belongs_to_associations_test.rb
diff options
context:
space:
mode:
authorMarcelo Giorgi <marklazz.uy@gmail.com>2010-09-15 12:26:54 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-09-28 15:22:50 -0300
commitcdfd013dd7953fc87038c73ecddbaa8cfe29a301 (patch)
treeaec0099a5b67e415c9255c2c63fcb723dd4154dc /activerecord/test/cases/associations/belongs_to_associations_test.rb
parent1ef2b47fb12a94f960b34c4bb1e6ad1f9c900e18 (diff)
downloadrails-cdfd013dd7953fc87038c73ecddbaa8cfe29a301.tar.gz
rails-cdfd013dd7953fc87038c73ecddbaa8cfe29a301.tar.bz2
rails-cdfd013dd7953fc87038c73ecddbaa8cfe29a301.zip
Set attributes properly for model built from association with conditions [#5562 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 742513230e..cbaa4990f7 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -474,4 +474,9 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
Author.belongs_to :special_author_address, :dependent => :restrict
end
end
+
+ def test_attributes_are_being_set_when_initialized_from_belongs_to_association_with_where_clause
+ new_firm = accounts(:signals37).build_firm(:name => 'Apple')
+ assert_equal new_firm.name, "Apple"
+ end
end