Class: Workarea::Admin::CreateReleaseUndosController
Instance Method Summary
collapse
#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
#create ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/workarea/admin/create_release_undos_controller.rb', line 12
def create
@undo_release.attributes = params[:release]
if @undo_release.save
@release.changesets.limit(Workarea.config.per_page).each do |changeset|
if changeset.releasable.present?
changeset.build_undo(release: @undo_release.model).save!
changeset.releasable.run_callbacks(:save)
end
end
BuildReleaseUndoChangesets.perform_async(
@undo_release.id,
@release.id
) if @release.changeset_count > Workarea.config.per_page
flash[:success] = t('workarea.admin.create_release_undos.flash_messages.saved')
redirect_to review_release_undo_path(@release, @undo_release)
else
render :new, status: :unprocessable_entity
end
end
|
#new ⇒ Object
9
10
|
# File 'app/controllers/workarea/admin/create_release_undos_controller.rb', line 9
def new
end
|
#review ⇒ Object
35
36
|
# File 'app/controllers/workarea/admin/create_release_undos_controller.rb', line 35
def review
end
|