Sha256: 1b1d5969c22e3fea9880750ff4db157ecf1e1447480c0d1e210d4965f82890f3

Contents?: true

Size: 877 Bytes

Versions: 16

Compression:

Stored size: 877 Bytes

Contents

class Avo::Current < ActiveSupport::CurrentAttributes
  # if Rails.env.development?
  # singleton_class.attr_accessor :previous_attributes
  # before_reset {
  #   puts ["before_reset->", self.previous_attributes].inspect
  #   if attributes.present?
  #     puts ["has attributes->"].inspect
  #     self.previous_attributes = attributes
  #   end
  #   puts ["before_reset->", self.previous_attributes].inspect
  # }

  # attr_accessor :previous_attributes

  # def previous_attributes=(value)
  #   @previous_attributes = value
  # end
  # end

  attribute :app
  attribute :license
  attribute :context, :user, :view_context
  attribute :error_manager
  attribute :resource_manager
  attribute :tool_manager
  attribute :plugin_manager
  attribute :locale

  delegate :params, to: :request

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
avo-3.0.1.beta20 lib/avo/current.rb
avo-3.0.1.beta21 lib/avo/current.rb
avo-3.0.1.beta17 lib/avo/current.rb
avo-3.0.1.beta22 lib/avo/current.rb
avo-3.0.1.beta18 lib/avo/current.rb
avo-3.0.1.beta19 lib/avo/current.rb
avo-3.0.1.beta15 lib/avo/current.rb
avo-3.0.1.beta16 lib/avo/current.rb
avo-3.0.1.beta14 lib/avo/current.rb
avo-3.0.1.beta12 lib/avo/current.rb
avo-3.0.1.beta13 lib/avo/current.rb
avo-3.0.1.beta10 lib/avo/current.rb
avo-3.0.1.beta11 lib/avo/current.rb
avo-3.0.0.pre19 lib/avo/current.rb
avo-3.0.1.beta8 lib/avo/current.rb
avo-3.0.1.beta9 lib/avo/current.rb