Sha256: 23f0c944edbb0fa15d91788dd28638d76d043ba5cd2a587da922f5454e4f5743

Contents?: true

Size: 474 Bytes

Versions: 7

Compression:

Stored size: 474 Bytes

Contents

class Memento
  module ActionControllerMethods
    
    def memento
      block_result = nil
      memento_session = Memento.instance.memento(current_user) do
        block_result = yield
      end
      if memento_session
        response.headers["X-Memento-Session-Id"] = memento_session.id.to_s
      end
      block_result
    end
    private :memento
  end
end

ActionController::Base.send(:include, Memento::ActionControllerMethods) if defined?(ActionController::Base)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
memento-0.3.7 lib/memento/action_controller_methods.rb
memento-0.3.6 lib/memento/action_controller_methods.rb
memento-0.3.5 lib/memento/action_controller_methods.rb
memento-0.3.4 lib/memento/action_controller_methods.rb
memento-0.3.3 lib/memento/action_controller_methods.rb
memento-0.3.2 lib/memento/action_controller_methods.rb
memento-0.3.1 lib/memento/action_controller_methods.rb