Skip to content

Instantly share code, notes, and snippets.

@brandonmikeska
Created August 13, 2014 19:22
Show Gist options
  • Save brandonmikeska/0fb04402c3003cab2466 to your computer and use it in GitHub Desktop.
Save brandonmikeska/0fb04402c3003cab2466 to your computer and use it in GitHub Desktop.
def validate_code!(code)
if BCrypt::Password.new(code) == hashed_code
self.activated_at = DateTime.now
save
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment