Class: Bulky::UpdatesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/bulky/updates_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



3
4
# File 'app/controllers/bulky/updates_controller.rb', line 3

def edit
end

#paramsObject



19
20
21
# File 'app/controllers/bulky/updates_controller.rb', line 19

def params
  @params ||= delete_blank(super)
end

#updateObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/bulky/updates_controller.rb', line 6

def update
  if params[:ids].blank?
    redirect_to bulky_edit_path(model: params[:model]), alert: I18n.t('flash.alert.blank_ids') and return
  end

  unless params[:bulk].is_a?(Hash)
    redirect_to bulky_edit_path(model: params[:model]), alert: I18n.t('flash.alert.bulk_not_hash') and return
  end

  Bulky.enqueue_update(model, ids, params[:bulk])
  redirect_to bulky_edit_path(model: params[:model]), notice: I18n.t('flash.notice.enqueue_update')
end