def logout
@title = t "user.logout.title"
- if params[:session] == request.session_options[:id]
+ if params[:session] == session.id
if session[:token]
token = UserToken.find_by(:token => session[:token])
token.destroy if token
# Ignore errors sending email
end
else
- @user.errors.set(:new_email, @user.errors.get(:email))
- @user.errors.set(:email, [])
+ @user.errors.add(:new_email, @user.errors[:email])
+ @user.errors.add(:email, [])
end
user.restore_email!