aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-21 01:16:30 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-21 01:16:30 +0000
commite4b89b4680d612dea7322a662aea7f83e5c718fb (patch)
treef34ac22856993c04fb03185811ede854a6a00963 /activemodel/lib/active_model/validations
parent379e468034a2d22fb3330694a080ff7375d2379a (diff)
downloadrails-e4b89b4680d612dea7322a662aea7f83e5c718fb.tar.gz
rails-e4b89b4680d612dea7322a662aea7f83e5c718fb.tar.bz2
rails-e4b89b4680d612dea7322a662aea7f83e5c718fb.zip
Validation options dont need explicit :on => :save
Diffstat (limited to 'activemodel/lib/active_model/validations')
-rw-r--r--activemodel/lib/active_model/validations/format.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/format.rb b/activemodel/lib/active_model/validations/format.rb
index c71567b993..8efce8ba2b 100644
--- a/activemodel/lib/active_model/validations/format.rb
+++ b/activemodel/lib/active_model/validations/format.rb
@@ -25,7 +25,7 @@ module ActiveModel
# not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The
# method, proc or string should return or evaluate to a true or false value.
def validates_format_of(*attr_names)
- configuration = { :on => :save, :with => nil }
+ configuration = { :with => nil }
configuration.update(attr_names.extract_options!)
raise(ArgumentError, "A regular expression must be supplied as the :with option of the configuration hash") unless configuration[:with].is_a?(Regexp)