Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.534 kB
class Rubyforger < ActiveRecord::Base
def authentic?(password)
password.present? && encrypted_password == Digest::MD5.hexdigest(password)
end
def user
@user ||= User.find_by_email(email)
end
def transferable?(password)
user if authentic?(password) && user
end
def self.transfer(email, password)
if rubyforger = Rubyforger.find_by_email(email)
if user = rubyforger.transferable?(password)
user.update_password(password)
rubyforger.destroy
user
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.