diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-05-19 01:05:20 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-05-19 01:05:20 +0000 |
commit | c50113bc6110624bd411466e7c36bdde23226959 (patch) | |
tree | 15d9e6843c9f9b301b1b0c4b76dd551dc77910e5 /activerecord/lib | |
parent | 0cd883e1e1752c92ba080850833c6989a057bf6c (diff) | |
download | rails-c50113bc6110624bd411466e7c36bdde23226959.tar.gz rails-c50113bc6110624bd411466e7c36bdde23226959.tar.bz2 rails-c50113bc6110624bd411466e7c36bdde23226959.zip |
create! no longer blows up when no attributes are passed and a :create scope is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 4194e68b2f..29c2b79226 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -712,6 +712,7 @@ module ActiveRecord if attributes.is_a?(Array) attributes.collect { |attr| create!(attr) } else + attributes ||= {} attributes.reverse_merge!(scope(:create)) if scoped?(:create) object = new(attributes) |