This version fixes false negatives for Lint/SymbolConversion when using string interpolation, for Style/RedundantArgument when using the safe navigation operator, for Style/RedundantParentheses when logical operators are involved and for Style/RedundantReturn with lambda ending with return. We're applying the new rules. Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.4 to 1.61.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.56.4...v1.61.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
34 lines
878 B
Ruby
34 lines
878 B
Ruby
class Admin::Legislation::HomepagesController < Admin::Legislation::BaseController
|
|
include Translatable
|
|
|
|
load_and_authorize_resource :process, class: "Legislation::Process"
|
|
|
|
def edit
|
|
end
|
|
|
|
def update
|
|
if @process.update(process_params)
|
|
link = legislation_process_path(@process)
|
|
redirect_back(fallback_location: request.referer || root_path,
|
|
notice: t("admin.legislation.processes.update.notice", link: link))
|
|
else
|
|
flash.now[:error] = t("admin.legislation.processes.update.error")
|
|
render :edit
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def process_params
|
|
params.require(:legislation_process).permit(allowed_params)
|
|
end
|
|
|
|
def allowed_params
|
|
[:homepage, :homepage_enabled, translation_params(::Legislation::Process)]
|
|
end
|
|
|
|
def resource
|
|
@process || ::Legislation::Process.find(params[:id])
|
|
end
|
|
end
|