Skip to content

Commit

Permalink
Override sorting_name to ignore SAC/CAS prefix in Sektion
Browse files Browse the repository at this point in the history
This avoids the broken SQL query modification
  • Loading branch information
rnestler committed Jun 17, 2024
1 parent 999e4f5 commit ea753c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
16 changes: 0 additions & 16 deletions app/helpers/sac_cas/sheet/group/nav_left.rb

This file was deleted.

9 changes: 9 additions & 0 deletions app/models/group/sektion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ class Group::Sektion < ::Group

has_many :sac_section_membership_configs, dependent: :destroy, foreign_key: :group_id

def sorting_name
display_name.delete_prefix(name_prefix).strip
end

def sac_cas_self_registration_url(host)
Groups::SektionSelfRegistrationLink.new(self, host).url
end

private

def name_prefix
language == 'DE' ? 'SAC' : 'CAS'
end
end
1 change: 0 additions & 1 deletion lib/hitobito_sac_cas/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class Wagon < Rails::Engine
Dropdown::TableDisplays.prepend SacCas::Dropdown::TableDisplays
Dropdown::GroupEdit.prepend SacCas::Dropdown::GroupEdit
Event::ParticipationButtons.prepend SacCas::Event::ParticipationButtons
Sheet::Group::NavLeft.prepend SacCas::Sheet::Group::NavLeft

admin_item = NavigationHelper::MAIN.find { |item| item[:label] == :admin }
admin_item[:active_for] += %w(cost_centers cost_units)
Expand Down

0 comments on commit ea753c0

Please sign in to comment.