Skip to content

Commit

Permalink
Extract person_academic_groups method
Browse files Browse the repository at this point in the history
  • Loading branch information
mpugach committed Jan 14, 2024
1 parent 2d9d0d4 commit 63138e9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/controllers/static_pages_controller.rb
Expand Up @@ -9,7 +9,17 @@ class StaticPagesController < ApplicationController
def home
redirect_to new_person_session_path if current_person.blank?

@person_academic_groups = [
@person_academic_groups = person_academic_groups

preset_certificates(current_person&.student_profile)
end

private

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def person_academic_groups
[
[current_person&.currently_praeposted_academic_groups, '.currently_praeposted_academic_groups'],
[current_person&.previously_praeposted_academic_groups, '.previously_praeposted_academic_groups'],
[current_person&.last_academic_groups, '.student_of_academic_groups'],
Expand All @@ -19,7 +29,7 @@ def home
[current_person&.currently_administrated_academic_groups, '.currently_administrated_academic_groups'],
[current_person&.previously_administrated_academic_groups, '.previously_administrated_academic_groups']
]

preset_certificates(current_person&.student_profile)
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
end

0 comments on commit 63138e9

Please sign in to comment.