Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created December 10, 2014 19:58
Show Gist options
  • Select an option

  • Save jtrim/1e965728892b79de2de7 to your computer and use it in GitHub Desktop.

Select an option

Save jtrim/1e965728892b79de2de7 to your computer and use it in GitHub Desktop.
class Activation < Struct.new(:user, :activation_token)
def activate
if user.activation_token == hash_token(activation_token)
user.update_attributes!({
activated_at: Time.now,
locked_at: nil,
activation_token: nil
})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment