aequitas
aequitas copied to clipboard
External validator freezes models
External validator freezes resource model
class User
attr_accessor :name, :age
end
class UserValidator
include Aequitas
validates_presence_of :name
end
user = User.new
validator = UserValidator.new(user)
puts validator.valid? # => false, as expected
user.name = "Tanya" # => can't modify frozen User (RuntimeError)
So it looks like one model is validated it can't be modified to make it pass validation?
This is a bug I did not catched since I do not use mutable business objects. Will fix this soon. Thx for reporting!
Thanks. The models are frozen with deep_freeze
from ice_nine
gem.