If an object is created that doesn't satisfy the validations there's no errors raised, but you can see them in object.errors. An error should be raised to warn the user. Example:
class User
include ShallowAttributes
attribute :name, String
validates :name, presence: true
end
> u = User.new(name: nil)
> #<TextDispatcher name=nil>
> u.errors
> #<ActiveModel::Errors:0x007fc153323090 @base=#<TextDispatcher name=nil>, @messages={:name=>["can't be blank"]}>
I'd expect
> u = User.new(name: nil)
> Error: name can't be blank
If an object is created that doesn't satisfy the validations there's no errors raised, but you can see them in
object.errors
. An error should be raised to warn the user. Example:I'd expect