14988: Updates *_filter callbacks to use the new *_action form.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 9 Apr 2019 20:38:40 +0000 (17:38 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 9 Apr 2019 20:38:40 +0000 (17:38 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

21 files changed:
apps/workbench/app/controllers/actions_controller.rb
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/controllers/container_requests_controller.rb
apps/workbench/app/controllers/containers_controller.rb
apps/workbench/app/controllers/healthcheck_controller.rb
apps/workbench/app/controllers/jobs_controller.rb
apps/workbench/app/controllers/logs_controller.rb
apps/workbench/app/controllers/pipeline_instances_controller.rb
apps/workbench/app/controllers/pipeline_templates_controller.rb
apps/workbench/app/controllers/projects_controller.rb
apps/workbench/app/controllers/repositories_controller.rb
apps/workbench/app/controllers/search_controller.rb
apps/workbench/app/controllers/sessions_controller.rb
apps/workbench/app/controllers/status_controller.rb
apps/workbench/app/controllers/tests_controller.rb
apps/workbench/app/controllers/user_agreements_controller.rb
apps/workbench/app/controllers/users_controller.rb
apps/workbench/app/controllers/websocket_controller.rb
apps/workbench/app/controllers/work_units_controller.rb
apps/workbench/app/controllers/workflows_controller.rb

index beeae0760c21dfe2558483176000347c25167ad9..7e9e292332acd4933f0b92ffb16f1630419d818f 100644 (file)
@@ -8,7 +8,7 @@ class ActionsController < ApplicationController
 
   # Skip require_thread_api_token if this is a show action
   # for an object uuid that supports anonymous access.
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name and
     params['uuid'] and
index 8d9e8578c529a618678f9a8136d8472ae81021ff..0200a3d1edfc092f2218ed6beda356b8c742bff1 100644 (file)
@@ -11,19 +11,19 @@ class ApplicationController < ActionController::Base
 
   ERROR_ACTIONS = [:render_error, :render_not_found]
 
-  around_filter :thread_clear
-  around_filter :set_current_request_id
-  around_filter :set_thread_api_token
+  around_action :thread_clear
+  around_action :set_current_request_id
+  around_action :set_thread_api_token
   # Methods that don't require login should
-  #   skip_around_filter :require_thread_api_token
-  around_filter :require_thread_api_token, except: ERROR_ACTIONS
-  before_filter :ensure_arvados_api_exists, only: [:index, :show]
-  before_filter :set_cache_buster
-  before_filter :accept_uuid_as_id_param, except: ERROR_ACTIONS
-  before_filter :check_user_agreements, except: ERROR_ACTIONS
-  before_filter :check_user_profile, except: ERROR_ACTIONS
-  before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS
-  before_filter :find_object_by_uuid, except: [:create, :index, :choose] + ERROR_ACTIONS
+  #   skip_around_action :require_thread_api_token
+  around_action :require_thread_api_token, except: ERROR_ACTIONS
+  before_action :ensure_arvados_api_exists, only: [:index, :show]
+  before_action :set_cache_buster
+  before_action :accept_uuid_as_id_param, except: ERROR_ACTIONS
+  before_action :check_user_agreements, except: ERROR_ACTIONS
+  before_action :check_user_profile, except: ERROR_ACTIONS
+  before_action :load_filters_and_paging_params, except: ERROR_ACTIONS
+  before_action :find_object_by_uuid, except: [:create, :index, :choose] + ERROR_ACTIONS
   theme :select_theme
 
   begin
index 0a7f22b95789edc163198fbf32ab55045317f298..ed10d63e6696cd619906fd01bacb76b987ba2d42 100644 (file)
@@ -9,17 +9,17 @@ require "uri"
 class CollectionsController < ApplicationController
   include ActionController::Live
 
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
-  skip_around_filter(:require_thread_api_token,
+  skip_around_action(:require_thread_api_token,
                      only: [:show_file, :show_file_links])
-  skip_before_filter(:find_object_by_uuid,
+  skip_before_action(:find_object_by_uuid,
                      only: [:provenance, :show_file, :show_file_links])
   # We depend on show_file to display the user agreement:
-  skip_before_filter :check_user_agreements, only: :show_file
-  skip_before_filter :check_user_profile, only: :show_file
+  skip_before_action :check_user_agreements, only: :show_file
+  skip_before_action :check_user_profile, only: :show_file
 
   RELATION_LIMIT = 5
 
index 454be448d9d1e7afad061ac983cd38780abd1365..d5627076f5e1d0b0dee23531fbe884dacb16aa64 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class ContainerRequestsController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
index f0e31644f1ba0b5ba8db27ef007be63382c16455..a8549cd5b82e8b9e82420d7f7478b2c3a9660247 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class ContainersController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
index 60043d9024c223558cabc9cfc51a1d2522e6e1f4..7afe4032a2c19f726465e8aae7b1f6cdf55dafc0 100644 (file)
@@ -3,17 +3,17 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class HealthcheckController < ApplicationController
-  skip_around_filter :thread_clear
-  skip_around_filter :set_thread_api_token
-  skip_around_filter :require_thread_api_token
-  skip_before_filter :ensure_arvados_api_exists
-  skip_before_filter :accept_uuid_as_id_param
-  skip_before_filter :check_user_agreements
-  skip_before_filter :check_user_profile
-  skip_before_filter :load_filters_and_paging_params
-  skip_before_filter :find_object_by_uuid
+  skip_around_action :thread_clear
+  skip_around_action :set_thread_api_token
+  skip_around_action :require_thread_api_token
+  skip_before_action :ensure_arvados_api_exists
+  skip_before_action :accept_uuid_as_id_param
+  skip_before_action :check_user_agreements
+  skip_before_action :check_user_profile
+  skip_before_action :load_filters_and_paging_params
+  skip_before_action :find_object_by_uuid
 
-  before_filter :check_auth_header
+  before_action :check_auth_header
 
   def check_auth_header
     mgmt_token = Rails.configuration.ManagementToken
index 204dbb76dfa545a19a3c3124b91acd58b6b77607..e38d3ba87b3e40e6df08e4d6150a2a3c392220a7 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class JobsController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
index 512f0a32e710e9037c167c05676733d5aa373cd3..7e413284bbc3ebb421434fc7e0748d0c897a7593 100644 (file)
@@ -3,5 +3,5 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class LogsController < ApplicationController
-  before_filter :ensure_current_user_is_admin
+  before_action :ensure_current_user_is_admin
 end
index 93bb86961386c1e9a299ec93057b2c046b1080bc..ab0e55b22a1a7c73aac99dcc5411641c7ada20a3 100644 (file)
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class PipelineInstancesController < ApplicationController
-  skip_before_filter :find_object_by_uuid, only: :compare
-  before_filter :find_objects_by_uuid, only: :compare
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_before_action :find_object_by_uuid, only: :compare
+  before_action :find_objects_by_uuid, only: :compare
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
index 7d94e3469a10792f148a32e5c3a84e67c564dbc4..c497c70d434c4b67edb1dab42c2558bdd8242b16 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class PipelineTemplatesController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }
index 4a7563a959d88cf70157c0b686c734ad7a66c6ff..cc657cbad92406d9887eb5f0a2173415aa8ff51e 100644 (file)
@@ -3,8 +3,8 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class ProjectsController < ApplicationController
-  before_filter :set_share_links, if: -> { defined? @object and @object}
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  before_action :set_share_links, if: -> { defined? @object and @object}
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     %w(show tab_counts public).include? ctrl.action_name
   }
index 5ca6f22b02f54bf2ea3b213b7106717cd10c845b..6ef541ebab23a23159d834ef117692812daa5f9e 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class RepositoriesController < ApplicationController
-  before_filter :set_share_links, if: -> { defined? @object }
+  before_action :set_share_links, if: -> { defined? @object }
 
   def index_pane_list
     %w(repositories help)
index 3775abd1ae9f1117926d7bde8c847fc32ad0cd60..80f3ff117a583c3e6b96df76b08f6d75e5dc4cd9 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class SearchController < ApplicationController
-  skip_before_filter :ensure_arvados_api_exists
+  skip_before_action :ensure_arvados_api_exists
 
   def find_objects_for_index
     search_what = Group
index 48fbc6bd04a708326d2dfe0f01afd5ae5383c12f..02db33d645947e60a86f4721998b682b16634029 100644 (file)
@@ -3,11 +3,11 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class SessionsController < ApplicationController
-  skip_around_filter :require_thread_api_token, :only => [:destroy, :logged_out]
-  skip_around_filter :set_thread_api_token, :only => [:destroy, :logged_out]
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :find_objects_for_index
-  skip_before_filter :ensure_arvados_api_exists
+  skip_around_action :require_thread_api_token, :only => [:destroy, :logged_out]
+  skip_around_action :set_thread_api_token, :only => [:destroy, :logged_out]
+  skip_before_action :find_object_by_uuid
+  skip_before_action :find_objects_for_index
+  skip_before_action :ensure_arvados_api_exists
 
   def destroy
     session.clear
index 90b7be564d4d12c5d8c593ea0ec0040a16a1c9a4..0a8fb5a282c5872b2b20b66cb4ee3dfb7f71a152 100644 (file)
@@ -3,8 +3,8 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class StatusController < ApplicationController
-  skip_around_filter :require_thread_api_token
-  skip_before_filter :find_object_by_uuid
+  skip_around_action :require_thread_api_token
+  skip_before_action :find_object_by_uuid
   def status
     # Allow non-credentialed cross-origin requests
     headers['Access-Control-Allow-Origin'] = '*'
index 5d2de4e5a974698455a91925c591c1391e5fccb4..73c1f4f34a6b2e8a760d5dad03bfc074e699b769 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class TestsController < ApplicationController
-  skip_before_filter :find_object_by_uuid
+  skip_before_action :find_object_by_uuid
   def mithril
   end
 end
index 2797c4c682fae377d92891a5072bea656148a900..bdfaa240335922e3b616bf4c10d791f34ded70ac 100644 (file)
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class UserAgreementsController < ApplicationController
-  skip_before_filter :check_user_agreements
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :check_user_profile
+  skip_before_action :check_user_agreements
+  skip_before_action :find_object_by_uuid
+  skip_before_action :check_user_profile
 
   def index
     if unsigned_user_agreements.empty?
index c954944e0b4b8ad75ff75a805caf2927893a8c50..d934af796509e2c172dcda8d2941daf889acd716 100644 (file)
@@ -3,11 +3,11 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class UsersController < ApplicationController
-  skip_around_filter :require_thread_api_token, only: :welcome
-  skip_before_filter :check_user_agreements, only: [:welcome, :inactive, :link_account, :merge]
-  skip_before_filter :check_user_profile, only: [:welcome, :inactive, :profile, :link_account, :merge]
-  skip_before_filter :find_object_by_uuid, only: [:welcome, :activity, :storage]
-  before_filter :ensure_current_user_is_admin, only: [:sudo, :unsetup, :setup]
+  skip_around_action :require_thread_api_token, only: :welcome
+  skip_before_action :check_user_agreements, only: [:welcome, :inactive, :link_account, :merge]
+  skip_before_action :check_user_profile, only: [:welcome, :inactive, :profile, :link_account, :merge]
+  skip_before_action :find_object_by_uuid, only: [:welcome, :activity, :storage]
+  before_action :ensure_current_user_is_admin, only: [:sudo, :unsetup, :setup]
 
   def show
     if params[:uuid] == current_user.uuid
index e6fa5afade6180d1c2d65757b7518a84e06dd6d3..ead7ac63652ab17b213cd19e78356798b0745fc1 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class WebsocketController < ApplicationController
-  skip_before_filter :find_objects_for_index
+  skip_before_action :find_objects_for_index
 
   def index
   end
index d3ded867c198f5c265fafb7b49a89d50e1515fc9..0f0033ce4965663ef76a7f2e479d8e38d7642dfb 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class WorkUnitsController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show_child_component' == ctrl.action_name
   }
index 3b98413e23a2224ef8da829f3ba8c6255d1adced..b7f99e855e69dab591e633d9a07a54baa6f03282 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class WorkflowsController < ApplicationController
-  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+  skip_around_action :require_thread_api_token, if: proc { |ctrl|
     Rails.configuration.anonymous_user_token and
     'show' == ctrl.action_name
   }