Class: MerbAuthSliceActivation::Activations

Inherits:
Application
  • Object
show all
Defined in:
app/controllers/activations.rb

Instance Method Summary collapse

Instance Method Details

#activateObject

Activate a user from the submitted activation code.

Returns

String

Empty string.

Raises:

  • (NotFound)


9
10
11
12
13
14
15
16
# File 'app/controllers/activations.rb', line 9

def activate
  session.user = Merb::Authentication.user_class.find_with_activation_code(params[:activation_code])
  raise NotFound if session.user.nil?
  if session.authenticated? && !session.user.activated?
    session.user.activate!
  end
  ""
end