From df8f0ab52128e173690f624575fef286d1a3cf4c Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 27 Nov 2018 12:04:00 -0600 Subject: Remove `options` assignment from ExtractsPath This assignment is only used by the Projects::NetworkController, so we're needlessly assigning this very generically-named instance variable on every controller which includes `ExtractsPath`, which is quite a few. Further, the way we were passing this hash to `HashWithIndifferentAccess` caused the following deprecation warning after upgrading to Rails 5: DEPRECATION WARNING: #to_hash unexpectedly ignores parameter filtering, and will change to enforce it in Rails 5.1. Enable `raise_on_unfiltered_parameters` to respect parameter filtering, which is the default in new applications. For the existing deprecated behaviour, call #to_unsafe_h instead. (called from new at lib/extracts_path.rb:116) --- lib/extracts_path.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/extracts_path.rb') diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index 655278da711..b2c8d46ede1 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -110,11 +110,6 @@ module ExtractsPath # resolved (e.g., when a user inserts an invalid path or ref). # rubocop:disable Gitlab/ModuleWithInstanceVariables def assign_ref_vars - # assign allowed options - allowed_options = ["filter_ref"] - @options = params.select {|key, value| allowed_options.include?(key) && !value.blank? } - @options = HashWithIndifferentAccess.new(@options) - @id = get_id @ref, @path = extract_ref(@id) @repo = @project.repository -- cgit v1.2.3