-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
on HEAD
require 'spec_helper' class Princess include Mongoid::Document field :primary_color def color primary_color.to_s end validates_presence_of :color end describe "Mongoid" do it "issue" do Princess.create! # raises NoMethodError: undefined method `color_before_type_cast' for #<Princess _id: 511a4e853b5552f1dd00001b, primary_color: nil> end end
Looks like Mongoid overrides ActiveModel validation and expects everything being validated to be a field.