Class: Mensa::BatchAction

Inherits:
Object
  • Object
show all
Includes:
ConfigReaders
Defined in:
app/tables/mensa/batch_action.rb

Overview

Represents a batch action that can be applied to multiple selected records.

batch :archive do

title "Archive"
process { |records| records.update_all(archived: true) }

end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config:, table:) ⇒ BatchAction

Returns a new instance of BatchAction.



17
18
19
20
21
# File 'app/tables/mensa/batch_action.rb', line 17

def initialize(name, config:, table:)
  @name = name
  @table = table
  @config = config
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'app/tables/mensa/batch_action.rb', line 15

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



15
16
17
# File 'app/tables/mensa/batch_action.rb', line 15

def table
  @table
end