diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-25 07:20:38 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-25 07:20:38 -0700 |
commit | 64affc9384e9e8845b0204b94c003265442bc3e2 (patch) | |
tree | 3621b556f01e3ed95a20abd89cf8c469b186e382 /activerecord/lib/active_record/base.rb | |
parent | 14c0f0ee12f87970744e8373b996cb64d7ed37f7 (diff) | |
parent | f5e4d13270dbce2bb880ef6529da68aaee017910 (diff) | |
download | rails-64affc9384e9e8845b0204b94c003265442bc3e2.tar.gz rails-64affc9384e9e8845b0204b94c003265442bc3e2.tar.bz2 rails-64affc9384e9e8845b0204b94c003265442bc3e2.zip |
Merge pull request #2236 from cldwalker/after_initialize
Fix after_initialize and Base.create edge case
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 2c162a6fc8..4136868b39 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -504,8 +504,7 @@ module ActiveRecord #:nodoc: if attributes.is_a?(Array) attributes.collect { |attr| create(attr, options, &block) } else - object = new(attributes, options) - yield(object) if block_given? + object = new(attributes, options, &block) object.save object end |