lib/aequitas/macros.rb in aequitas-0.0.1 vs lib/aequitas/macros.rb in aequitas-0.0.2
- old
+ new
@@ -277,10 +277,11 @@
# @option [Boolean] :integer_only
# Use to restrict allowed values to integers.
#
def validates_numericalness_of(*attribute_names)
options = Macros.extract_options(attribute_names)
+ validation_rules.add(Rule::Value, attribute_names, options)
validation_rules.add(Rule::Numericalness, attribute_names, options)
end
# Validates that the specified attribute is present.
#
@@ -337,9 +338,14 @@
# # casted into a Date object.
# end
def validates_primitive_type_of(*attribute_names)
options = Macros.extract_options(attribute_names)
validation_rules.add(Rule::PrimitiveType, attribute_names, options)
+ end
+
+ def validates_value_of(*attribute_names)
+ options = Macros.extract_options(attribute_names)
+ validation_rules.add(Rule::Value, attribute_names, options)
end
# Validates that the value of a field is within a range/set.
#
# This validation is defined by passing a field along with a :set