mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove argument that is accessible as attribute
This commit is contained in:
parent
b8c6c08452
commit
61fef76106
1 changed files with 3 additions and 3 deletions
|
@ -17,8 +17,8 @@ module ActiveModel
|
||||||
raise ArgumentError, "Either :with or :without must be supplied (but not both)"
|
raise ArgumentError, "Either :with or :without must be supplied (but not both)"
|
||||||
end
|
end
|
||||||
|
|
||||||
check_options_validity(options, :with)
|
check_options_validity :with
|
||||||
check_options_validity(options, :without)
|
check_options_validity :without
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -37,7 +37,7 @@ module ActiveModel
|
||||||
source.start_with?("^") || (source.end_with?("$") && !source.end_with?("\\$"))
|
source.start_with?("^") || (source.end_with?("$") && !source.end_with?("\\$"))
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_options_validity(options, name)
|
def check_options_validity(name)
|
||||||
option = options[name]
|
option = options[name]
|
||||||
if option && !option.is_a?(Regexp) && !option.respond_to?(:call)
|
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}"
|
raise ArgumentError, "A regular expression or a proc or lambda must be supplied as :#{name}"
|
||||||
|
|
Loading…
Reference in a new issue