Skip to content
This repository
Browse code

Remove DEFAULT_VALIDATION_OPTIONS from validations

  • Loading branch information...
commit 379e468034a2d22fb3330694a080ff7375d2379a 1 parent 22ad30e
Pratik authored March 21, 2009
2  activemodel/lib/active_model/validations.rb
@@ -9,8 +9,6 @@ def self.included(base) # :nodoc:
9 9
     end
10 10
 
11 11
     module ClassMethods
12  
-      DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze
13  
-
14 12
       # Adds a validation method or block to the class. This is useful when
15 13
       # overriding the +validate+ instance method becomes too unwieldly and
16 14
       # you're looking for more descriptive declaration of your validations.
4  activemodel/lib/active_model/validations/length.rb
@@ -40,9 +40,7 @@ module ClassMethods
40 40
       #   Defaults to <tt>lambda{ |value| value.split(//) }</tt> which counts individual characters.
41 41
       def validates_length_of(*attrs)
42 42
         # Merge given options with defaults.
43  
-        options = {
44  
-          :tokenizer => lambda {|value| value.split(//)}
45  
-        }.merge(DEFAULT_VALIDATION_OPTIONS)
  43
+        options = { :tokenizer => lambda {|value| value.split(//)} }
46 44
         options.update(attrs.extract_options!.symbolize_keys)
47 45
 
48 46
         # Ensure that one and only one range option is specified.

0 notes on commit 379e468

Please sign in to comment.
Something went wrong with that request. Please try again.