aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/inclusion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/validations/inclusion.rb')
-rw-r--r--activemodel/lib/active_model/validations/inclusion.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb
index 43b1d87d0b..d32aebeb88 100644
--- a/activemodel/lib/active_model/validations/inclusion.rb
+++ b/activemodel/lib/active_model/validations/inclusion.rb
@@ -15,7 +15,8 @@ module ActiveModel
end
def validate_each(record, attribute, value)
- exclusions = options[:in].respond_to?(:call) ? options[:in].call(record) : options[:in]
+ delimiter = options[:in]
+ exclusions = delimiter.respond_to?(:call) ? delimiter.call(record) : delimiter
unless exclusions.send(inclusion_method(exclusions), value)
record.errors.add(attribute, :inclusion, options.except(:in).merge!(:value => value))
end