Files
danbooru/app/logical/user_email_change.rb
r888888888 eab2eb1d82 fixes #1651
2013-05-21 17:52:03 -07:00

19 lines
335 B
Ruby

class UserEmailChange
attr_reader :user, :password, :new_email
def initialize(user, new_email, password)
@user = user
@new_email = new_email
@password = password
end
def process
if User.authenticate(user.name, password).nil?
false
else
user.email = new_email
user.save
end
end
end