diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-09-23 22:44:14 +0300 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-09-23 22:48:02 +0300 |
commit | be42c05054bda2417fdd26e86e0f4c80c9d0ccb6 (patch) | |
tree | 50c21744e03193fa6ee2458d3904b127ac4317ef /app/controllers/profiles | |
parent | 4c8d2232ca3e4b97a313e9ac4d96dee2b3de9e84 (diff) |
Enable more frozen string in app/controllers/
Enables frozen string for the following:
* app/controllers/dashboard/**/*.rb
* app/controllers/explore/**/*.rb
* app/controllers/google_api/**/*.rb
* app/controllers/groups/**/*.rb
* app/controllers/import/**/*.rb
* app/controllers/instance_statistics/**/*.rb
* app/controllers/ldap/**/*.rb
* app/controllers/oauth/**/*.rb
* app/controllers/profiles/**/*.rb
Partially addresses #47424.
Diffstat (limited to 'app/controllers/profiles')
14 files changed, 29 insertions, 1 deletions
diff --git a/app/controllers/profiles/accounts_controller.rb b/app/controllers/profiles/accounts_controller.rb index fd9cb9fca3e..cb3180f4196 100644 --- a/app/controllers/profiles/accounts_controller.rb +++ b/app/controllers/profiles/accounts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::AccountsController < Profiles::ApplicationController include AuthHelper diff --git a/app/controllers/profiles/active_sessions_controller.rb b/app/controllers/profiles/active_sessions_controller.rb index f1e77d68acd..efe7ede5efa 100644 --- a/app/controllers/profiles/active_sessions_controller.rb +++ b/app/controllers/profiles/active_sessions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::ActiveSessionsController < Profiles::ApplicationController def index @sessions = ActiveSession.list(current_user) diff --git a/app/controllers/profiles/application_controller.rb b/app/controllers/profiles/application_controller.rb index c8be288b9a0..52b046ef64f 100644 --- a/app/controllers/profiles/application_controller.rb +++ b/app/controllers/profiles/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::ApplicationController < ApplicationController layout 'profile' end diff --git a/app/controllers/profiles/avatars_controller.rb b/app/controllers/profiles/avatars_controller.rb index 4f030ded80f..3378a09628c 100644 --- a/app/controllers/profiles/avatars_controller.rb +++ b/app/controllers/profiles/avatars_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::AvatarsController < Profiles::ApplicationController def destroy @user = current_user diff --git a/app/controllers/profiles/chat_names_controller.rb b/app/controllers/profiles/chat_names_controller.rb index a186c5f36a8..2e78b9e6dc7 100644 --- a/app/controllers/profiles/chat_names_controller.rb +++ b/app/controllers/profiles/chat_names_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::ChatNamesController < Profiles::ApplicationController before_action :chat_name_token, only: [:new] before_action :chat_name_params, only: [:new, :create, :deny] diff --git a/app/controllers/profiles/emails_controller.rb b/app/controllers/profiles/emails_controller.rb index a39824ec9c8..503eda250b4 100644 --- a/app/controllers/profiles/emails_controller.rb +++ b/app/controllers/profiles/emails_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::EmailsController < Profiles::ApplicationController before_action :find_email, only: [:destroy, :resend_confirmation_instructions] diff --git a/app/controllers/profiles/gpg_keys_controller.rb b/app/controllers/profiles/gpg_keys_controller.rb index c32507756e8..8c34a66c374 100644 --- a/app/controllers/profiles/gpg_keys_controller.rb +++ b/app/controllers/profiles/gpg_keys_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::GpgKeysController < Profiles::ApplicationController before_action :set_gpg_key, only: [:destroy, :revoke] diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 6035258667e..01801c31327 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::KeysController < Profiles::ApplicationController skip_before_action :authenticate_user!, only: [:get_keys] diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb index 00bd2040b9a..b719b70c56e 100644 --- a/app/controllers/profiles/notifications_controller.rb +++ b/app/controllers/profiles/notifications_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::NotificationsController < Profiles::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def show diff --git a/app/controllers/profiles/passwords_controller.rb b/app/controllers/profiles/passwords_controller.rb index b8ccc6e3c99..a0391d677c4 100644 --- a/app/controllers/profiles/passwords_controller.rb +++ b/app/controllers/profiles/passwords_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::PasswordsController < Profiles::ApplicationController skip_before_action :check_password_expiration, only: [:new, :create] skip_before_action :check_two_factor_requirement, only: [:new, :create] diff --git a/app/controllers/profiles/personal_access_tokens_controller.rb b/app/controllers/profiles/personal_access_tokens_controller.rb index b357741e3fb..4b6ec2697b7 100644 --- a/app/controllers/profiles/personal_access_tokens_controller.rb +++ b/app/controllers/profiles/personal_access_tokens_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::PersonalAccessTokensController < Profiles::ApplicationController def index set_index_vars diff --git a/app/controllers/profiles/preferences_controller.rb b/app/controllers/profiles/preferences_controller.rb index ed0f98179eb..37ac11dc6a1 100644 --- a/app/controllers/profiles/preferences_controller.rb +++ b/app/controllers/profiles/preferences_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::PreferencesController < Profiles::ApplicationController before_action :user diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 29ff18a1219..ba94196b2f9 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::TwoFactorAuthsController < Profiles::ApplicationController skip_before_action :check_two_factor_requirement @@ -30,7 +32,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController unless two_factor_grace_period_expired? grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours - flash.now[:alert] << " You need to do this before #{l(grace_period_deadline)}." + flash.now[:alert] = flash.now[:alert] + " You need to do this before #{l(grace_period_deadline)}." end end diff --git a/app/controllers/profiles/u2f_registrations_controller.rb b/app/controllers/profiles/u2f_registrations_controller.rb index e3d7737f44a..e6a154fb6aa 100644 --- a/app/controllers/profiles/u2f_registrations_controller.rb +++ b/app/controllers/profiles/u2f_registrations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Profiles::U2fRegistrationsController < Profiles::ApplicationController def destroy u2f_registration = current_user.u2f_registrations.find(params[:id]) |