mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
provide a more sementicthe local variables name for ActiveModel::Validations::Clusivity#include? method
the original name `exclusion` is a bit confusing when using with the method `inclusion_method` rename it to a more logic neutral name.
This commit is contained in:
parent
396f23234a
commit
e8fe6660d2
1 changed files with 8 additions and 8 deletions
|
@ -15,15 +15,15 @@ module ActiveModel
|
|||
private
|
||||
|
||||
def include?(record, value)
|
||||
exclusions = if delimiter.respond_to?(:call)
|
||||
delimiter.call(record)
|
||||
elsif delimiter.respond_to?(:to_sym)
|
||||
record.send(delimiter)
|
||||
else
|
||||
delimiter
|
||||
end
|
||||
members = if delimiter.respond_to?(:call)
|
||||
delimiter.call(record)
|
||||
elsif delimiter.respond_to?(:to_sym)
|
||||
record.send(delimiter)
|
||||
else
|
||||
delimiter
|
||||
end
|
||||
|
||||
exclusions.send(inclusion_method(exclusions), value)
|
||||
members.send(inclusion_method(members), value)
|
||||
end
|
||||
|
||||
def delimiter
|
||||
|
|
Loading…
Reference in a new issue