Sha256: 6c05ab48fdfde8f71cf1da901986dee7a6cad99ae6967d341f66ab055e3578d2

Contents?: true

Size: 616 Bytes

Versions: 16

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    module LocationStorable
      extend ActiveSupport::Concern

      included do
        before_action :store_user_location!, if: :storable_location?
      end

      private

      def pdf_request?
        request.path.index('pdfjs').present? || request.path.index('pdf-proxy').present?
      end

      def storable_location?
        request.get? && is_navigational_format? && !devise_controller? && !request.xhr? && !pdf_request?
      end

      def store_user_location!
        store_location_for(:user, request.fullpath)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.5.4 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.5.3 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.5.2 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.5.1 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.5.0 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.4.2 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.4.1 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.4.0 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.3.1 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.1.4 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.3.0 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.1.3 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.2.0 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.1.2 app/controllers/concerns/lcms/engine/location_storable.rb
lcms-engine-0.1.0 app/controllers/concerns/lcms/engine/location_storable.rb