1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't pass a block as we are yielding

This commit is contained in:
Andrew White 2011-05-17 22:30:19 +01:00
parent 324f1451b0
commit f3b0be812e

View file

@ -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?