Sha256: 9ba0af81e235c0b457155893a5fb73ab9ba9c390e52e085e3ae70f844ff6e22c

Contents?: true

Size: 505 Bytes

Versions: 21

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

module NeetoCommonsBackend
  module StoreUserLocation
    extend ActiveSupport::Concern

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

      def storable_location?
        request.path != "/sign_in" &&
        request.path != "/sign_up" &&
        !request.xhr? &&
        request.get? &&
        !user_signed_in?
      end

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
neeto-commons-backend-1.0.109 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.108 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.107 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.106 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.105 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.104 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.103 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.102 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.101 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.100 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.99 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.98 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.97 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.96 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.95 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.94 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.93 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.92 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.91 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb
neeto-commons-backend-1.0.90 lib/neeto_commons_backend/controllers/concerns/store_user_location.rb