Bugfix: categories are shown on process update
These changes fix a bug that causes categories of a legislation process to be wiped on update of the process. It also adds a regression test for this fix.
This commit is contained in:
@@ -24,8 +24,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
||||
|
||||
def update
|
||||
if @process.update(process_params)
|
||||
set_tag_list
|
||||
|
||||
link = legislation_process_path(@process)
|
||||
redirect_back(fallback_location: (request.referer || root_path),
|
||||
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||
@@ -77,11 +75,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
||||
]
|
||||
end
|
||||
|
||||
def set_tag_list
|
||||
@process.set_tag_list_on(:customs, process_params[:custom_list])
|
||||
@process.save!
|
||||
end
|
||||
|
||||
def resource
|
||||
@process || ::Legislation::Process.find(params[:id])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user