aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-11-12 05:09:05 +0000
committerJamis Buck <jamis@37signals.com>2005-11-12 05:09:05 +0000
commit7321a41e1b108f4194ba9dfef63391e9c15a0839 (patch)
treefedda34215086b30ca331ede7c9092dbead1c0c1
parent047c75fa06f0b76f484acdc75a63e55b4eb24274 (diff)
downloadrails-7321a41e1b108f4194ba9dfef63391e9c15a0839.tar.gz
rails-7321a41e1b108f4194ba9dfef63391e9c15a0839.tar.bz2
rails-7321a41e1b108f4194ba9dfef63391e9c15a0839.zip
Make Validations#create! use the current scope
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2984 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-xactiverecord/lib/active_record/validations.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index 10a6c0fab3..904153bf24 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -660,6 +660,8 @@ module ActiveRecord
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