Sha256: aedd48c5cef9268f720116dad3f16ccc870dbc04c3e29847da20835d4544a026

Contents?: true

Size: 454 Bytes

Versions: 6

Compression:

Stored size: 454 Bytes

Contents

module Memento
  module ActionControllerMethods

    def memento
      block_result = nil
      memento_session = 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

6 entries across 6 versions & 1 rubygems

Version Path
memento-0.5.1 lib/memento/action_controller_methods.rb
memento-0.5.0 lib/memento/action_controller_methods.rb
memento-0.4.3 lib/memento/action_controller_methods.rb
memento-0.4.2 lib/memento/action_controller_methods.rb
memento-0.4.1 lib/memento/action_controller_methods.rb
memento-0.4.0 lib/memento/action_controller_methods.rb