Skip to content

Instantly share code, notes, and snippets.

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