8fd2c08472
The check for continue_params&.key?(:to) in Projects::ImportsController caused an exception in redirect_to if this key contained a nil value. Since url_for won't add any params for an empty hash, we can just return that in continue_params if params[:continue] isn't present, and simplify the code in the controllers to check for the values we actually want to use.
16 lines
384 B
Ruby
16 lines
384 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ContinueParams
|
|
include InternalRedirect
|
|
extend ActiveSupport::Concern
|
|
|
|
def continue_params
|
|
continue_params = params[:continue]
|
|
return {} unless continue_params
|
|
|
|
continue_params = continue_params.permit(:to, :notice, :notice_now)
|
|
continue_params[:to] = safe_redirect_path(continue_params[:to])
|
|
|
|
continue_params
|
|
end
|
|
end
|