diff --git a/lib/sorcery/model/submodules/user_activation.rb b/lib/sorcery/model/submodules/user_activation.rb index 64baa22c..79cc8948 100644 --- a/lib/sorcery/model/submodules/user_activation.rb +++ b/lib/sorcery/model/submodules/user_activation.rb @@ -103,6 +103,11 @@ def setup_activation self.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 + def setup_activation! + setup_activation + sorcery_adapter.save(:validate => false, :raise_on_failure => true) + end + # clears activation code, sets the user as 'active' and optionaly sends a success email. def activate! config = sorcery_config