class RailsParam::Validator::MaxLength

Public Instance Methods

valid_value?() click to toggle source
# File lib/rails_param/validator/max_length.rb, line 4
def valid_value?
  value.nil? || options[:max_length] >= value.length
end

Private Instance Methods

error_message() click to toggle source
# File lib/rails_param/validator/max_length.rb, line 10
def error_message
  "Parameter #{name} cannot have length greater than #{options[:max_length]}"
end