Class: Validatable::ValidatesLengthOf

Inherits:
ValidationBase
  • Object
show all
Defined in:
lib/devise/orm/mongo_mapper/mm-validations.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#message(instance) ⇒ Object



50
51
52
53
54
# File 'lib/devise/orm/mongo_mapper/mm-validations.rb', line 50

def message(instance)
  min = !within.nil? ? within.first : minimum
  max = !within.nil? ? within.last : maximum
  super || "must be between #{min} and #{max} characters long"
end