-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
The validates_inclusion_of is not using the coerced value. Is this intentional? Here is an example:
require 'mongoid' class Book include Mongoid::Document field :genre, type: Symbol validates_inclusion_of :genre, in: [:drama, :adventure] end b = Book.new b.genre = :drama b.valid? # true b.genre = 'drama' b.valid? # false
Mongoid used to return true for the second case too. This code was tested in the newest gem version (currently 3.1.0), but I don't know exactly when this was changed.