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,7 +15,7 @@ module ActiveModel
private
def include?(record, value)
exclusions = if delimiter.respond_to?(:call)
members = if delimiter.respond_to?(:call)
delimiter.call(record)
elsif delimiter.respond_to?(:to_sym)
record.send(delimiter)
@ -23,7 +23,7 @@ module ActiveModel
delimiter
end
exclusions.send(inclusion_method(exclusions), value)
members.send(inclusion_method(members), value)
end
def delimiter