aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authordreamfall <amarant.st@gmail.com>2012-01-17 13:18:58 +0300
committerdreamfall <amarant.st@gmail.com>2012-01-17 13:18:58 +0300
commite84998cc212c6c96c279ebd41619f51054f5642f (patch)
tree50166de246f6060b8ed83dc121f60ebc3b1cdf94 /activemodel/lib
parent5f8274efe128ffeec8fa3179460f5167a078f007 (diff)
downloadrails-e84998cc212c6c96c279ebd41619f51054f5642f.tar.gz
rails-e84998cc212c6c96c279ebd41619f51054f5642f.tar.bz2
rails-e84998cc212c6c96c279ebd41619f51054f5642f.zip
validates method should not change options argument
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations/validates.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb
index 8e09f6ac35..0e6b349e94 100644
--- a/activemodel/lib/active_model/validations/validates.rb
+++ b/activemodel/lib/active_model/validations/validates.rb
@@ -80,7 +80,7 @@ module ActiveModel
# validates :password, :presence => true, :confirmation => true, :if => :password_required?
#
def validates(*attributes)
- defaults = attributes.extract_options!
+ defaults = attributes.extract_options!.dup
validations = defaults.slice!(*_validates_default_keys)
raise ArgumentError, "You need to supply at least one attribute" if attributes.empty?