Sha256: 3772129969ff7ff6cf03be64a04419d4d3ce45b25c3d2cd4b35a5bdabfc20317

Contents?: true

Size: 526 Bytes

Versions: 82

Compression:

Stored size: 526 Bytes

Contents

module LHS
  class Railtie < Rails::Railtie
    initializer "lhs.hook_into_controller_initialization" do
      class ActionController::Base

        def initialize
          prepare_lhs_request_cycle_cache
          super
        end

        private

        def prepare_lhs_request_cycle_cache
          return unless LHS.config.request_cycle_cache_enabled
          LHS::Record::RequestCycleCache::RequestCycleThreadRegistry.request_id = [Time.now.to_f, request.object_id].join('#')
        end
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
lhs-11.0.1 lib/lhs/railtie.rb
lhs-11.0.0 lib/lhs/railtie.rb