Method: Authlogic::ActsAsAuthentic::Password::Methods::InstanceMethods#password=

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

#password=(pass) ⇒ Object

This is a virtual method. Once a password is passed to it, it will create new password salt as well as encrypt the password.



195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/authlogic/acts_as_authentic/password.rb', line 195

def password=(pass)
  return if ignore_blank_passwords? && pass.blank?
  run_callbacks :password_set do
    @password = pass
    if password_salt_field
      send("#{password_salt_field}=", Authlogic::Random.friendly_token)
    end
    send(
      "#{crypted_password_field}=",
      crypto_provider.encrypt(*encrypt_arguments(@password, false))
    )
    @password_changed = true
  end
end