add validation methods as instance methods as well per AM

This commit is contained in:
Adam Meehan
2010-08-03 14:56:59 +10:00
parent 34379e1e15
commit 6bed71152a
2 changed files with 21 additions and 1 deletions

View File

@@ -2,7 +2,12 @@ module ValidatesTimeliness
module HelperMethods
extend ActiveSupport::Concern
module ClassMethods
included do
include ValidationMethods
extend ValidationMethods
end
module ValidationMethods
def validates_date(*attr_names)
validates_with Validator, _merge_attributes(attr_names).merge(:type => :date)
end