Configuration
Expected Behavior
The docs should be clear and not say two different things in two places.
Actual Behavior
The README recommends the following steps to activate a user:
User.load_from_activation_token(token)
@user.setup_activation
@user.activate!
This suggests that a call to setup_activation is required to activate a user. In the Wiki, however, setup_activation is omitted (and only mentioned at the very bottom in an example for resending the activation email):
if @user = User.load_from_activation_token(params[:id])
@user.activate!
redirect_to(login_path, :notice => 'User was successfully activated.')
Source for setup_activation at the time of writing:
|
def setup_activation |
|
config = sorcery_config |
|
generated_activation_token = TemporaryToken.generate_random_token |
|
send(:"#{config.activation_token_attribute_name}=", generated_activation_token) |
|
send(:"#{config.activation_state_attribute_name}=", 'pending') |
|
send(:"#{config.activation_token_expires_at_attribute_name}=", Time.now.in_time_zone + config.activation_token_expiration_period) if config.activation_token_expiration_period |
|
end |
Desired changes
Steps to Reproduce
Doesn't apply.
Configuration
Expected Behavior
The docs should be clear and not say two different things in two places.
Actual Behavior
The README recommends the following steps to activate a user:
This suggests that a call to
setup_activationis required to activate a user. In the Wiki, however,setup_activationis omitted (and only mentioned at the very bottom in an example for resending the activation email):Source for
setup_activationat the time of writing:sorcery/lib/sorcery/model/submodules/user_activation.rb
Lines 90 to 96 in 6fdc703
Desired changes
setup_activationis neededsetup_activation.Steps to Reproduce
Doesn't apply.