1
0
Fork 0
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:
Steven Yang 2013-06-29 18:32:48 +08:00
parent 396f23234a
commit e8fe6660d2

View file

@ -15,15 +15,15 @@ module ActiveModel
private private
def include?(record, value) def include?(record, value)
exclusions = if delimiter.respond_to?(:call) members = if delimiter.respond_to?(:call)
delimiter.call(record) delimiter.call(record)
elsif delimiter.respond_to?(:to_sym) elsif delimiter.respond_to?(:to_sym)
record.send(delimiter) record.send(delimiter)
else else
delimiter delimiter
end end
exclusions.send(inclusion_method(exclusions), value) members.send(inclusion_method(members), value)
end end
def delimiter def delimiter