Sha256: 62c4b6b644851d09a897ea62bf835eca5753663af1491d46b523a8400edd11c3
Contents?: true
Size: 1.44 KB
Versions: 62
Compression:
Stored size: 1.44 KB
Contents
module Workarea module Admin class BulkActionProductEditsController < Admin::ApplicationController required_permissions :catalog before_action :find_bulk_action def edit end def update @bulk_action.reset_to_default! if @bulk_action.update_attributes(params[:bulk_action]) flash[:success] = t('workarea.admin.bulk_action_product_edits.flash_messages.success') redirect_to review_bulk_action_product_edit_path(@bulk_action) else flash[:error] = t('workarea.admin.bulk_action_product_edits.flash_messages.error') render :edit end end def review end def publish release = SavePublishing.new(nil, params).release if release.nil? || release.valid? @bulk_action.update_attributes(release_id: release.try(:id)) PublishBulkAction.perform_async(@bulk_action.id) flash[:success] = t('workarea.admin.bulk_action_product_edits.flash_messages.publish') redirect_to catalog_products_path else flash[:error] = release.errors.full_messages render :review end end private def find_bulk_action model = BulkAction::ProductEdit.find(params[:id]) @bulk_action = Admin::BulkActionProductEditViewModel.new( model, view_model_options ) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems
Version | Path |
---|---|
workarea-admin-3.4.13 | app/controllers/workarea/admin/bulk_action_product_edits_controller.rb |
workarea-admin-3.4.12 | app/controllers/workarea/admin/bulk_action_product_edits_controller.rb |