From e8fe6660d2ff33422a3568c3b1ce2af3496ac712 Mon Sep 17 00:00:00 2001 From: Steven Yang Date: Sat, 29 Jun 2013 18:32:48 +0800 Subject: 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. --- activemodel/lib/active_model/validations/clusivity.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'activemodel') diff --git a/activemodel/lib/active_model/validations/clusivity.rb b/activemodel/lib/active_model/validations/clusivity.rb index c5aacb010a..1c35cb7c35 100644 --- a/activemodel/lib/active_model/validations/clusivity.rb +++ b/activemodel/lib/active_model/validations/clusivity.rb @@ -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 -- cgit v1.2.3