-# Captures for parent templates
- content_for :page_title, t("accounts.forgotten_password.page_title")
= resource
= resource.email
class User < ActiveRecord::Base
# Devise Authentication Properties
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
# User properties
attr_accessible :first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :sign_in_count, :timezone, :gmtoffset
# always treat emails as lowercase fields
before_save do
self.email.downcase! if self.email
end
# Exportable properties
def as_json(options={})
{:user => self.serializable_hash(:only => [:id, :first_name, :last_name, :email, :last_sign_in_at, :timezone, :gmtoffset])}
end
def send_welcome_message!(client, user)
generate_reset_password_token!
::Devise.mailer.welcome_instructions(self, client, user).deliver
end
def self.find_for_authentication(conditions)
conditions[:email].downcase!
super(conditions)
end
end