Class: Workarea::Admin::BulkActionDeletionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/bulk_action_deletions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#confirmObject



15
16
17
18
19
20
21
# File 'app/controllers/workarea/admin/bulk_action_deletions_controller.rb', line 15

def confirm
  PublishBulkAction.perform_async(@bulk_action.id)

  flash[:success] =
    t('workarea.admin.bulk_action_deletions.flash_messages.created')
  redirect_to return_to.presence || root_path
end

#editObject



6
7
8
9
10
11
12
13
# File 'app/controllers/workarea/admin/bulk_action_deletions_controller.rb', line 6

def edit
  confirm && (return) if @bulk_action.count < confirmation_threshold

  @search = BulkActionSelections.new(params[:id], params)
  @results = @search.results
                    .map { |r| wrap_in_view_model(r) }
                    .first(confirmation_threshold)
end