Module: Intercession

Defined in:
lib/intercession.rb

Constant Summary collapse

VERSION =

Duh.

"3.0.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/intercession.rb', line 6

def self.included klass
  klass.append_after_filter :intercede_after

  ks =  []
  ks << ActionDispatch::Session::AbstractStore::SessionHash rescue nil
  ks << CGI::Session rescue nil

  ks.compact.each { |c| c.send :include, Transient::Session }
end

.test!Object



16
17
18
# File 'lib/intercession.rb', line 16

def self.test!
  ActionController::TestSession.send :include, Transient::Session
end

Instance Method Details

#intercede_afterObject



20
21
22
23
# File 'lib/intercession.rb', line 20

def intercede_after
  # FIX: this obviously won't work with after filters in subclasses.
  session.before_save if session.respond_to? :before_save
end