Module: Authlogic::Session::Existence::ClassMethods

Defined in:
lib/authlogic/session/existence.rb

Instance Method Summary collapse

Instance Method Details

#create(*args, &block) ⇒ Object

A convenince method. The same as:

session = UserSession.new(*args)
session.save

Instead you can do:

UserSession.create(*args)


28
29
30
31
32
# File 'lib/authlogic/session/existence.rb', line 28

def create(*args, &block)
  session = new(*args)
  session.save(&block)
  session
end

#create!(*args) ⇒ Object

Same as create but calls create!, which raises an exception when validation fails.



35
36
37
38
39
# File 'lib/authlogic/session/existence.rb', line 35

def create!(*args)
  session = new(*args)
  session.save!
  session
end