Permalink
Browse files

Make Validations#create! use the current scope

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2984 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
jamis committed Nov 12, 2005
1 parent 047c75f commit 7321a41e1b108f4194ba9dfef63391e9c15a0839
Showing with 2 additions and 0 deletions.
  1. +2 −0 activerecord/lib/active_record/validations.rb
@@ -660,6 +660,8 @@ def create!(attributes = nil)
if attributes.is_a?(Array)
attributes.collect { |attr| create!(attr) }
else
+ attributes.reverse_merge!(scope(:create)) if scoped?(:create)
+
object = new(attributes)
object.save!
object

0 comments on commit 7321a41

Please sign in to comment.