lib/avo/current.rb in avo-3.0.0.beta1 vs lib/avo/current.rb in avo-3.0.0.pre1

- old
+ new

@@ -1,39 +1,5 @@ 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 - - delegate :params, to: :request - - def request - view_context.request || ActionDispatch::Request.empty - end - - def current_user - Rails.logger.warn "DEPRECATION WARNING: Avo::Current.current_user become deprecated and will become obsolete on futhure versions. Please use Avo::Current.user instead." - - user - end + attribute :params, :request, :context, :current_user, :view_context end