-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override sorting_name to ignore SAC/CAS prefix in Sektion for hitobito#2673 #621
Conversation
b77aedf
to
59e1cd8
Compare
app/models/group/sektion.rb
Outdated
private | ||
|
||
def name_prefix | ||
language == 'DE' ? 'SAC' : 'CAS' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also just always remove both prefixes.
59e1cd8
to
50010bd
Compare
def sub_layers | ||
super.reorder(Arel.sql(NAME_WITHOUT_PREFIX)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added in #529, but didn't work properly.
This avoids the broken SQL query modification
50010bd
to
ea753c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! 🚀
- we changed display_name.delete_prefix('SAC ').delete_prefix('CAS ') to include a space.
fixes GROUPS: Sortierung Groups mit static_name hitobito#2673
This avoids the broken SQL query modification.
Ref: #2673
Depends on hitobito/hitobito#2677