From f3b0be812e39114e5c6768aa6db59c3945fe3a33 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Tue, 17 May 2011 22:30:19 +0100 Subject: Don't pass a block as we are yielding --- activerecord/lib/active_record/associations/singular_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/singular_association.rb') diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index 68fe0bde76..ce1f2a5543 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -25,7 +25,7 @@ module ActiveRecord build(attributes, options, &block).tap { |record| record.save! } end - def build(attributes = {}, options = {}, &block) + def build(attributes = {}, options = {}) record = reflection.build_association(attributes, options) record.assign_attributes(create_scope.except(*record.changed), :without_protection => true) yield(record) if block_given? -- cgit v1.2.3