Skip to content

Commit d50870a

Browse files
committed
Rubocop fixes
1 parent a914809 commit d50870a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

app/controllers/better_together/application_controller.rb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def check_platform_setup
5858
redirect_to setup_wizard_path
5959
end
6060

61-
def set_platform_invitation
61+
# rubocop:todo Metrics/PerceivedComplexity
62+
# rubocop:todo Metrics/MethodLength
63+
# rubocop:todo Metrics/AbcSize
64+
def set_platform_invitation # rubocop:todo Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
6265
# Only proceed if there's an invitation token in the URL or already in the session.
6366
return unless params[:invitation_code].present? || session[:platform_invitation_token].present?
6467

@@ -83,11 +86,14 @@ def set_platform_invitation
8386

8487
@platform_invitation = ::BetterTogether::PlatformInvitation.pending.find_by(token: token)
8588

86-
unless @platform_invitation
87-
session.delete(:platform_invitation_token)
88-
session.delete(:platform_invitation_expires_at)
89-
end
89+
return if @platform_invitation
90+
91+
session.delete(:platform_invitation_token)
92+
session.delete(:platform_invitation_expires_at)
9093
end
94+
# rubocop:enable Metrics/AbcSize
95+
# rubocop:enable Metrics/MethodLength
96+
# rubocop:enable Metrics/PerceivedComplexity
9197

9298
def check_platform_privacy
9399
return if helpers.host_platform.privacy_public?
@@ -103,7 +109,9 @@ def valid_platform_invitation_token_present?
103109
token = session[:platform_invitation_token]
104110
return false unless token.present?
105111

106-
return false if session[:platform_invitation_expires_at].present? && Time.current > session[:platform_invitation_expires_at]
112+
if session[:platform_invitation_expires_at].present? && Time.current > session[:platform_invitation_expires_at]
113+
return false
114+
end
107115

108116
::BetterTogether::PlatformInvitation.pending.exists?(token: token)
109117
end

0 commit comments

Comments
 (0)