Sha256: ca4caf90d93af1b674a8f2770bf571ab43e0031653a075ccc0baa44f30d92d36

Contents?: true

Size: 402 Bytes

Versions: 5

Compression:

Stored size: 402 Bytes

Contents

class PasswordField < StringField
  undef search_terms_set
  def default_input_type
    :password
  end
  
  def validate(record, errors)
    PasswordConfirmationValidation.validate(nil, self, name, nil, record, errors)
    super
  end
  
  def from_json(value, record)
    if value.blank?
      throw :ignore_value
    else
      value.to_s
    end
  end
end

Field::TYPES['password'] = PasswordField

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/models/core/fields/password_field.rb
yodel-0.0.4 lib/yodel/models/core/fields/password_field.rb
yodel-0.0.3 lib/yodel/models/core/fields/password_field.rb
yodel-0.0.2 lib/yodel/models/core/fields/password_field.rb
yodel-0.0.1 lib/yodel/models/core/fields/password_field.rb