aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorSteven Yang <yangchenyun@gmail.com>2013-06-29 18:32:48 +0800
committerSteven Yang <yangchenyun@gmail.com>2013-06-29 18:36:40 +0800
commite8fe6660d2ff33422a3568c3b1ce2af3496ac712 (patch)
tree07e9cec61e7b0dc5b5cf3c6b995a853a487bd00e /activemodel/lib
parent396f23234af89fcc92a9509ee3764a60d4f06210 (diff)
downloadrails-e8fe6660d2ff33422a3568c3b1ce2af3496ac712.tar.gz
rails-e8fe6660d2ff33422a3568c3b1ce2af3496ac712.tar.bz2
rails-e8fe6660d2ff33422a3568c3b1ce2af3496ac712.zip
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.
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations/clusivity.rb16
1 files changed, 8 insertions, 8 deletions
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