Module: DataMapper::Validate::AutoValidate
- Defined in:
- lib/dm-types/enum.rb
Instance Method Summary collapse
Instance Method Details
#auto_generate_validations(property) ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/dm-types/enum.rb', line 59 def auto_generate_validations(property) orig_auto_generate_validations(property) return unless property.[:auto_validation] if property.type.ancestors.include?(Types::Enum) validates_within property.name, ({:set => property.type.flag_map.values}, property, :within) end end |
#orig_auto_generate_validations ⇒ Object
58 |
# File 'lib/dm-types/enum.rb', line 58 alias :orig_auto_generate_validations :auto_generate_validations |