module Yema module Virtus module Validations def self.included(base) base.instance_eval do include ::Virtus::ValueObject include Yema::Validations extend ClassMethods end end module ClassMethods private def virtus_add_attribute(attribute) super build_validation(attribute) end def build_validation(attribute) rules.merge(Yema::Virtus::Attribute.build(attribute).rules) end end end end end