From dcc298ff064cc10c68f7acb6bc8737f67e8a7399 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Mon, 11 Dec 2017 10:45:44 +0100 Subject: [PATCH] replace alias_method by super --- .../patches/users_helper_patch.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/open_project/two_factor_authentication/patches/users_helper_patch.rb b/lib/open_project/two_factor_authentication/patches/users_helper_patch.rb index e8ba1e79ae..6dd960fcb6 100644 --- a/lib/open_project/two_factor_authentication/patches/users_helper_patch.rb +++ b/lib/open_project/two_factor_authentication/patches/users_helper_patch.rb @@ -2,21 +2,16 @@ module OpenProject::TwoFactorAuthentication::Patches module UsersHelperPatch def self.included(base) # :nodoc: base.prepend(InstanceMethods) - - base.class_eval do - alias_method :user_settings_tabs_without_2fa, :user_settings_tabs - alias_method :user_settings_tabs, :user_settings_tabs_with_2fa - end end module InstanceMethods # Adds a 2FA tab to the user administration page - def user_settings_tabs_with_2fa + def user_settings_tabs # Core defined data if OpenProject::TwoFactorAuthentication::TokenStrategyManager.enabled? - user_settings_tabs_without_2fa + [{ name: 'two_factor_authentication', partial: 'users/two_factor_authentication', label: 'two_factor_authentication.label_two_factor_authentication' }] + super + [{ name: 'two_factor_authentication', partial: 'users/two_factor_authentication', label: 'two_factor_authentication.label_two_factor_authentication' }] else - user_settings_tabs_without_2fa + super end end end