Sha256: 5d74644edfbf7f96a7a179039b0d5a77f97f43748d62d332a4fa04257fc33ea2

Contents?: true

Size: 510 Bytes

Versions: 8

Compression:

Stored size: 510 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery

  def rescue_action(e)
    raise e
  end

  # Returns id of hypothetical current user
  def current_user
    @current_user ||= OpenStruct.new(:id => 153).tap do |obj|
      # Invoking `id` returns the `object_id` value in Ruby18 unless specifically overwritten
      def obj.id; 153; end if RUBY_VERSION < '1.9'
    end
  end

  def info_for_paper_trail
    {:ip => request.remote_ip, :user_agent => request.user_agent}
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
paper_trail-4.2.0 test/dummy/app/controllers/application_controller.rb
paper_trail-4.1.0 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.2 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.1 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.0 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.0.rc2 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.0.rc1 test/dummy/app/controllers/application_controller.rb
paper_trail-4.0.0.beta2 test/dummy/app/controllers/application_controller.rb