Module: Authlogic::ActsAsAuthentic::Email::Config

Defined in:
lib/authlogic/acts_as_authentic/email.rb

Overview

Configuration to modify how Authlogic handles the email field.

Instance Method Summary collapse

Instance Method Details

#email_field(value = nil) ⇒ Object Also known as: email_field=

The name of the field that stores email addresses.

  • Default: :email, if it exists

  • Accepts: Symbol



21
22
23
# File 'lib/authlogic/acts_as_authentic/email.rb', line 21

def email_field(value = nil)
  config(:email_field, value, first_column_to_exist(nil, :email))
end

#validate_email_field(value = nil) ⇒ Object Also known as: validate_email_field=

Toggles validating the email field or not.

  • Default: true

  • Accepts: Boolean



30
31
32
# File 'lib/authlogic/acts_as_authentic/email.rb', line 30

def validate_email_field(value = nil)
  config(:validate_email_field, value, true)
end

#validates_format_of_email_field_options(value = nil) ⇒ Object Also known as: validates_format_of_email_field_options=

A hash of options for the validates_format_of call for the email field. Allows you to change this however you want.

  • Default: => email_regex, :message => I18n.t(‘error_messages.email_invalid’, :default => “should look like an email address.”)

  • Accepts: Hash of options accepted by validates_format_of



48
49
50
# File 'lib/authlogic/acts_as_authentic/email.rb', line 48

def validates_format_of_email_field_options(value = nil)
  config(:validates_format_of_email_field_options, value, {:with => email_regex, :message => I18n.t('error_messages.email_invalid', :default => "should look like an email address.")})
end

#validates_length_of_email_field_options(value = nil) ⇒ Object Also known as: validates_length_of_email_field_options=

A hash of options for the validates_length_of call for the email field. Allows you to change this however you want.

  • Default: => 6..100

  • Accepts: Hash of options accepted by validates_length_of



39
40
41
# File 'lib/authlogic/acts_as_authentic/email.rb', line 39

def validates_length_of_email_field_options(value = nil)
  config(:validates_length_of_email_field_options, value, {:within => 6..100})
end