Login or sign up Lost password?
Login or sign up
class Person include Active Model:: Validations validates_with My Validator validates_with Other Validator, on: :create validates_with Strict Validator, strict: true validate :cannot_be_robot def cannot_be_robot errors.add(:base, ' A person cannot be a robot') if person_is_robot end end Person.validators # =class Comment include Active Model:: Validations validate :must_be_friends def must_be_friends errors.add(:base, ' Must be friends to leave a comment') unless commenter.friend_of?