Given the following interaction, I would expect behavior around validations to be:
class Foo < ::ActiveInteractin::Base
string :bar
validates :bar, presence: true
end
x = Foo.new
x.valid? == false # it's actually nil
x.bar = "baz"
x.valid? == true # unfortunately it's still nil
In each test, rather than the boolean expected, I'm seeing nil returned. In the first example, that's at least still falsey, but it's not the behavior I'd expect from a typical failed validation using vanilla ActiveModel validations. In the second example that should cure the validation problem, but I still see nil.
Given the following interaction, I would expect behavior around validations to be:
In each test, rather than the boolean expected, I'm seeing
nil
returned. In the first example, that's at least still falsey, but it's not the behavior I'd expect from a typical failed validation using vanilla ActiveModel validations. In the second example that should cure the validation problem, but I still seenil
.