gitlab-org--gitlab-foss/app/controllers/concerns/continue_params.rb
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00

16 lines
381 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