Module: Sorcery::Model::Submodules::UserActivation::InstanceMethods

Defined in:
lib/sorcery/model/submodules/user_activation.rb

Instance Method Summary collapse

Instance Method Details

#activate!Object

clears activation code, sets the user as ‘active’ and optionaly sends a success email.



91
92
93
94
95
96
97
# File 'lib/sorcery/model/submodules/user_activation.rb', line 91

def activate!
  config = sorcery_config
  self.send(:"#{config.activation_token_attribute_name}=", nil)
  self.send(:"#{config.activation_state_attribute_name}=", "active")
  send_activation_success_email! unless self.external?
  save!(:validate => false) # don't run validations
end