Module: Clearance

Defined in:
lib/clearance/user.rb,
lib/clearance/engine.rb,
lib/clearance/configuration.rb,
lib/clearance/authentication.rb,
lib/clearance/shoulda_macros.rb,
lib/clearance/shoulda_macros.rb

Defined Under Namespace

Modules: Authentication, Shoulda, User Classes: Configuration, ConfirmationsController, Engine, PasswordsController, SessionsController, UsersController

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



12
13
14
# File 'lib/clearance/configuration.rb', line 12

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Configure Clearance someplace sensible, like config/initializers/clearance.rb

If you want users to only be signed in during the current session instead of being remembered, do this:

config.cookie_expiration = lambda { }

Examples:

Clearance.configure do |config|
  config.mailer_sender     = '[email protected]'
  config.cookie_expiration = lambda { 2.weeks.from_now.utc }
end

Yields:



28
29
30
31
# File 'lib/clearance/configuration.rb', line 28

def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end