Skip to content

Commit

Permalink
Use #pluck to get all IDs for batch action
Browse files Browse the repository at this point in the history
  • Loading branch information
mlt committed Oct 4, 2017
1 parent 2c6ba0c commit 49a669e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tabulatr/data/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def data_for_table(params, locals: {}, controller: nil, &block)
def execute_batch_actions batch_param, selected_ids
if batch_param.present? && @batch_actions.present?
batch_param = batch_param.keys.first.to_sym if batch_param.is_a?(Hash)
selected_ids = @relation.map(&:id) if selected_ids.empty?
selected_ids = @relation.pluck(:id) if selected_ids.empty?
@batch_actions.yield(Invoker.new(batch_param, selected_ids))
end
end
Expand Down

0 comments on commit 49a669e

Please sign in to comment.