Sha256: 76c5ae8d6230b2edbc25a9070eab122bf215c5badf2b3bdddb6ddaa4cfc64422

Contents?: true

Size: 673 Bytes

Versions: 130

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module PayloadInfo
    extend ActiveSupport::Concern

    included do
      def append_info_to_payload(payload)
        super
        payload[:user_id] = try(:current_user).try(:id)
        payload[:organization_id] = try(:current_organization).try(:id)
        payload[:app] = try(:current_organization).try(:name)
        payload[:remote_ip] = request.remote_ip
        payload[:referer] = request.referer.to_s
        payload[:request_id] = request.uuid
        payload[:user_agent] = request.user_agent
        payload[:xhr] = request.xhr? ? "true" : "false"
      end
    end
  end
end

Version data entries

130 entries across 130 versions & 2 rubygems

Version Path
decidim-core-0.28.4 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.9 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.3 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.8 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.2 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.7 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.1 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.6 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.26.10 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.26.9 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.0 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.5 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.0.rc5 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.28.0.rc4 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.26.8 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.4 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.3 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.26.7 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.26.5 app/controllers/concerns/decidim/payload_info.rb
decidim-core-0.27.2 app/controllers/concerns/decidim/payload_info.rb