lib/avo/base_action.rb in avo-3.5.6.beta1 vs lib/avo/base_action.rb in avo-3.5.6
- old
+ new
@@ -18,10 +18,11 @@
attr_accessor :response
attr_accessor :record
attr_accessor :resource
attr_accessor :user
attr_reader :arguments
+ attr_reader :icon
# TODO: find a differnet way to delegate this to the uninitialized Current variable
delegate :context, to: Avo::Current
def current_user
Avo::Current.user
@@ -99,14 +100,15 @@
end
self.class.to_s.demodulize.underscore.humanize(keep_id_suffix: true)
end
- def initialize(record: nil, resource: nil, user: nil, view: nil, arguments: {})
+ def initialize(record: nil, resource: nil, user: nil, view: nil, arguments: {}, icon: :play)
@record = record
@resource = resource
@user = user
@view = Avo::ViewInquirer.new(view)
+ @icon = icon
@arguments = Avo::ExecutionContext.new(
target: arguments,
resource: resource,
record: record
).handle.with_indifferent_access