use activemodel scoped class name in helper method to remove need for .kind override

This commit is contained in:
Adam Meehan
2011-02-24 21:12:49 +11:00
parent 9d654b1122
commit e3dea5aebd
3 changed files with 1 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ module ActiveModel
self.timeliness_validated_attributes ||= []
self.timeliness_validated_attributes += (attr_names - self.timeliness_validated_attributes)
end
validates_with ValidatesTimeliness::Validator, options
validates_with TimelinessValidator, options
end
end

View File

@@ -22,10 +22,6 @@ module ValidatesTimeliness
RESTRICTION_ERROR_MESSAGE = "Error occurred validating %s for %s restriction:\n%s"
def self.kind
:timeliness
end
def initialize(options)
@type = options.delete(:type) || :datetime
@allow_nil, @allow_blank = options.delete(:allow_nil), options.delete(:allow_blank)