From 61fef761065e310a8c398bd8f52da01cb82723e6 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 15 Nov 2013 01:00:53 -0200 Subject: [PATCH] Remove argument that is accessible as attribute --- activemodel/lib/active_model/validations/format.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/activemodel/lib/active_model/validations/format.rb b/activemodel/lib/active_model/validations/format.rb index b6cc162582..f17105e574 100644 --- a/activemodel/lib/active_model/validations/format.rb +++ b/activemodel/lib/active_model/validations/format.rb @@ -17,8 +17,8 @@ module ActiveModel 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 @@ module ActiveModel 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}"