Sha256: 3f3c38e3f5c808f24cae31a108b069b0a8d05774e112125e0c762830eaaa2d0d

Contents?: true

Size: 654 Bytes

Versions: 24

Compression:

Stored size: 654 Bytes

Contents

class Avo::Current < ActiveSupport::CurrentAttributes
  attribute :app
  attribute :license
  attribute :context
  attribute :user
  attribute :view_context
  attribute :error_manager
  attribute :resource_manager
  attribute :tool_manager
  attribute :plugin_manager
  attribute :locale

  # The tenant attributes are here so the user can add them on their own will
  attribute :tenant_id
  attribute :tenant

  # Protect from error #<RuntimeError: Missing rack.input> when request is ActionDispatch::Request.empty
  def params
    request.params
  rescue
    {}
  end

  def request
    view_context&.request || ActionDispatch::Request.empty
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
avo-3.9.2 lib/avo/current.rb
avo-3.9.1 lib/avo/current.rb
avo-3.8.2 lib/avo/current.rb
avo-3.9.0 lib/avo/current.rb
avo-3.8.1 lib/avo/current.rb
avo-3.8.0 lib/avo/current.rb
avo-3.6.4 lib/avo/current.rb
avo-3.6.3 lib/avo/current.rb
avo-3.6.2 lib/avo/current.rb
avo-3.6.1 lib/avo/current.rb
avo-3.6.0 lib/avo/current.rb
avo-3.5.8 lib/avo/current.rb
avo-3.5.7 lib/avo/current.rb
avo-3.5.6 lib/avo/current.rb
avo-3.5.6.beta1 lib/avo/current.rb
avo-3.5.5 lib/avo/current.rb
avo-3.5.4 lib/avo/current.rb
avo-3.5.3 lib/avo/current.rb
avo-3.5.2 lib/avo/current.rb
avo-3.5.1 lib/avo/current.rb