Permalink
Browse files

Remove argument that is accessible as attribute

  • Loading branch information...
1 parent b8c6c08 commit 61fef761065e310a8c398bd8f52da01cb82723e6 @carlosantoniodasilva carlosantoniodasilva committed Nov 15, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activemodel/lib/active_model/validations/format.rb
@@ -17,8 +17,8 @@ def check_validity!
raise ArgumentError, "Either :with or :without must be supplied (but not both)"
end
- check_options_validity(options, :with)
- check_options_validity(options, :without)
+ check_options_validity :with
+ check_options_validity :without
end
private
@@ -37,7 +37,7 @@ def regexp_using_multiline_anchors?(regexp)
source.start_with?("^") || (source.end_with?("$") && !source.end_with?("\\$"))
end
- def check_options_validity(options, name)
+ def check_options_validity(name)
option = options[name]
if option && !option.is_a?(Regexp) && !option.respond_to?(:call)
raise ArgumentError, "A regular expression or a proc or lambda must be supplied as :#{name}"

0 comments on commit 61fef76

Please sign in to comment.