diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-04-16 15:03:37 +0300 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-04-20 16:39:37 +0300 |
commit | 5a4ebfb47af40de6cfe29fe59dae82f8c244e5e3 (patch) | |
tree | f87ac47a9d14849659a8a40a53576080593b0670 /app/controllers/import | |
parent | 76aade28e25d1f6e8924b35ed9bd365c8889987f (diff) |
Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/bitbucket_controller.rb | 12 | ||||
-rw-r--r-- | app/controllers/import/github_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/import/gitlab_controller.rb | 8 | ||||
-rw-r--r-- | app/controllers/import/google_code_controller.rb | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/app/controllers/import/bitbucket_controller.rb b/app/controllers/import/bitbucket_controller.rb index bb8d7e0235c..ca78a4aaa8e 100644 --- a/app/controllers/import/bitbucket_controller.rb +++ b/app/controllers/import/bitbucket_controller.rb @@ -1,15 +1,15 @@ class Import::BitbucketController < Import::BaseController - before_filter :verify_bitbucket_import_enabled - before_filter :bitbucket_auth, except: :callback + before_action :verify_bitbucket_import_enabled + before_action :bitbucket_auth, except: :callback rescue_from OAuth::Error, with: :bitbucket_unauthorized def callback - request_token = session.delete(:oauth_request_token) + request_token = session.delete(:oauth_request_token) raise "Session expired!" if request_token.nil? request_token.symbolize_keys! - + access_token = client.get_token(request_token, params[:oauth_verifier], callback_import_bitbucket_url) current_user.bitbucket_access_token = access_token.token @@ -21,7 +21,7 @@ class Import::BitbucketController < Import::BaseController def status @repos = client.projects - + @already_added_projects = current_user.created_projects.where(import_type: "bitbucket") already_added_projects_names = @already_added_projects.pluck(:import_source) @@ -41,7 +41,7 @@ class Import::BitbucketController < Import::BaseController repo_owner = repo["owner"] repo_owner = current_user.username if repo_owner == client.user["user"]["username"] @target_namespace = params[:new_namespace].presence || repo_owner - + namespace = get_or_create_namespace || (render and return) unless Gitlab::BitbucketImport::KeyAdder.new(repo, current_user).execute diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb index 87b41454c77..b9f99c1b88a 100644 --- a/app/controllers/import/github_controller.rb +++ b/app/controllers/import/github_controller.rb @@ -1,6 +1,6 @@ class Import::GithubController < Import::BaseController - before_filter :verify_github_import_enabled - before_filter :github_auth, except: :callback + before_action :verify_github_import_enabled + before_action :github_auth, except: :callback rescue_from Octokit::Unauthorized, with: :github_unauthorized @@ -36,7 +36,7 @@ class Import::GithubController < Import::BaseController repo_owner = repo.owner.login repo_owner = current_user.username if repo_owner == client.user.login @target_namespace = params[:new_namespace].presence || repo_owner - + namespace = get_or_create_namespace || (render and return) @project = Gitlab::GithubImport::ProjectCreator.new(repo, namespace, current_user).execute diff --git a/app/controllers/import/gitlab_controller.rb b/app/controllers/import/gitlab_controller.rb index bddbfded812..1b8962d8924 100644 --- a/app/controllers/import/gitlab_controller.rb +++ b/app/controllers/import/gitlab_controller.rb @@ -1,6 +1,6 @@ class Import::GitlabController < Import::BaseController - before_filter :verify_gitlab_import_enabled - before_filter :gitlab_auth, except: :callback + before_action :verify_gitlab_import_enabled + before_action :gitlab_auth, except: :callback rescue_from OAuth2::Error, with: :gitlab_unauthorized @@ -13,7 +13,7 @@ class Import::GitlabController < Import::BaseController def status @repos = client.projects - + @already_added_projects = current_user.created_projects.where(import_type: "gitlab") already_added_projects_names = @already_added_projects.pluck(:import_source) @@ -33,7 +33,7 @@ class Import::GitlabController < Import::BaseController repo_owner = repo["namespace"]["path"] repo_owner = current_user.username if repo_owner == client.user["username"] @target_namespace = params[:new_namespace].presence || repo_owner - + namespace = get_or_create_namespace || (render and return) @project = Gitlab::GitlabImport::ProjectCreator.new(repo, namespace, current_user).execute diff --git a/app/controllers/import/google_code_controller.rb b/app/controllers/import/google_code_controller.rb index 73c912e285b..8a9ff652263 100644 --- a/app/controllers/import/google_code_controller.rb +++ b/app/controllers/import/google_code_controller.rb @@ -1,8 +1,8 @@ class Import::GoogleCodeController < Import::BaseController - before_filter :user_map, only: [:new_user_map, :create_user_map] + before_action :user_map, only: [:new_user_map, :create_user_map] def new - + end def callback @@ -68,7 +68,7 @@ class Import::GoogleCodeController < Import::BaseController def status unless client.valid? - return redirect_to new_import_google_path + return redirect_to new_import_google_path end @repos = client.repos |