diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-21 01:14:58 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-21 01:14:58 +0000 |
commit | 379e468034a2d22fb3330694a080ff7375d2379a (patch) | |
tree | e17902e87e35ee37f578d030bda57e9018f63f47 /activemodel | |
parent | 22ad30ed600a3304c749b0406325b3b43de3d607 (diff) | |
download | rails-379e468034a2d22fb3330694a080ff7375d2379a.tar.gz rails-379e468034a2d22fb3330694a080ff7375d2379a.tar.bz2 rails-379e468034a2d22fb3330694a080ff7375d2379a.zip |
Remove DEFAULT_VALIDATION_OPTIONS from validations
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations/length.rb | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 59e919a364..caab9e7b73 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -9,8 +9,6 @@ module ActiveModel end module ClassMethods - DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze - # Adds a validation method or block to the class. This is useful when # overriding the +validate+ instance method becomes too unwieldly and # you're looking for more descriptive declaration of your validations. diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb index 9736595990..bb9a269a02 100644 --- a/activemodel/lib/active_model/validations/length.rb +++ b/activemodel/lib/active_model/validations/length.rb @@ -40,9 +40,7 @@ module ActiveModel # Defaults to <tt>lambda{ |value| value.split(//) }</tt> which counts individual characters. def validates_length_of(*attrs) # Merge given options with defaults. - options = { - :tokenizer => lambda {|value| value.split(//)} - }.merge(DEFAULT_VALIDATION_OPTIONS) + options = { :tokenizer => lambda {|value| value.split(//)} } options.update(attrs.extract_options!.symbolize_keys) # Ensure that one and only one range option is specified. |