lib/matchers/validations/inclusion_of.rb in mongoid-rspec-1.13.0 vs lib/matchers/validations/inclusion_of.rb in mongoid-rspec-2.0.0.rc1
- old
+ new
@@ -5,10 +5,10 @@
def initialize(name)
super(name, :inclusion)
end
def to_allow(*values)
- @allowed_values = values.map(&:to_a).flatten
+ @allowed_values = values.map { |v| v.respond_to?(:to_a) ? v.to_a : v }.flatten
self
end
def matches?(actual)
return false unless result = super(actual)
\ No newline at end of file