Permalink
Browse files

provide a more sementicthe local variables name for ActiveModel::Vali…

…dations::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.
  • Loading branch information...
1 parent 396f232 commit e8fe6660d2ff33422a3568c3b1ce2af3496ac712 @yangchenyun yangchenyun committed Jun 29, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 activemodel/lib/active_model/validations/clusivity.rb
View
16 activemodel/lib/active_model/validations/clusivity.rb
@@ -15,15 +15,15 @@ def check_validity!
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

0 comments on commit e8fe666

Please sign in to comment.