lib/matchers/validations/exclusion_of.rb in mongoid-minitest-0.0.1 vs lib/matchers/validations/exclusion_of.rb in mongoid-minitest-0.0.2
- old
+ new
@@ -9,14 +9,14 @@
def to_not_allow(*values)
@not_allowed_values = values.flatten
self
end
- def matches?(actual)
- return false unless result = super(actual)
+ def matches?(subject)
+ return false unless result = super(subject)
if @not_allowed_values
- allowed_values = @not_allowed_values - @validator.options[:in]
+ allowed_values = @not_allowed_values - @validator.options[:in].to_a
if allowed_values.empty?
@positive_message << " not allowing all values mentioned"
else
@negative_message << " allowing the values:"
@negative_message << " #{to_sentence(allowed_values)}"