diff options
Diffstat (limited to 'activemodel/lib/active_model/validator.rb')
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index de1a271dde..2953126c3c 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -94,6 +94,7 @@ module ActiveModel #:nodoc: # # This setup method is only called when used with validation macros or the # class level <tt>validates_with</tt> method. + # class Validator attr_reader :options @@ -101,6 +102,7 @@ module ActiveModel #:nodoc: # # PresenceValidator.kind # => :presence # UniquenessValidator.kind # => :uniqueness + # def self.kind @kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym unless anonymous? end |