lib/macros.rb in validatable-1.6.3 vs lib/macros.rb in validatable-1.6.4

- old
+ new

@@ -225,7 +225,11 @@ # * map - A hash that maps attributes of the child to attributes of the parent. # * if - A block that when executed must return true of the validation will not occur. def include_validations_for(attribute_to_validate, options = {}) children_to_validate << ChildValidation.new(attribute_to_validate, options[:map] || {}, options[:if] || lambda { true }) end + + def before_validation(&block) + before_validations << block + end end end \ No newline at end of file