Skip to content
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

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

rnestler
Copy link
Contributor

@rnestler rnestler commented Jun 12, 2024

This avoids the broken SQL query modification.

Ref: #2673

Depends on hitobito/hitobito#2677

@rnestler rnestler force-pushed the feature/2673-sort-group-names-remove-prefix branch from b77aedf to 59e1cd8 Compare June 12, 2024 15:55
@rnestler rnestler requested a review from mtnstar June 12, 2024 15:55
private

def name_prefix
language == 'DE' ? 'SAC' : 'CAS'
Copy link
Contributor Author

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.

@rnestler rnestler self-assigned this Jun 17, 2024
@rnestler rnestler force-pushed the feature/2673-sort-group-names-remove-prefix branch from 59e1cd8 to 50010bd Compare June 17, 2024 09:13
@rnestler rnestler marked this pull request as ready for review June 17, 2024 12:47
@rnestler rnestler requested a review from Largo June 17, 2024 12:48
Comment on lines -13 to -15
def sub_layers
super.reorder(Arel.sql(NAME_WITHOUT_PREFIX))
end
Copy link
Contributor Author

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
@rnestler rnestler force-pushed the feature/2673-sort-group-names-remove-prefix branch from 50010bd to ea753c0 Compare June 17, 2024 12:55
@rnestler rnestler linked an issue Jun 17, 2024 that may be closed by this pull request
6 tasks
@Largo Largo merged commit a89be3b into master Jun 17, 2024
8 of 9 checks passed
@Largo Largo deleted the feature/2673-sort-group-names-remove-prefix branch June 17, 2024 14:40
Copy link
Contributor

@Largo Largo left a 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

@Largo Largo changed the title Override sorting_name to ignore SAC/CAS prefix in Sektion Override sorting_name to ignore SAC/CAS prefix in Sektion for GROUPS: Sortierung Groups mit static_name #2673 Jun 17, 2024
@Largo Largo changed the title Override sorting_name to ignore SAC/CAS prefix in Sektion for GROUPS: Sortierung Groups mit static_name #2673 Override sorting_name to ignore SAC/CAS prefix in Sektion for hitobito#2673 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GROUPS: Sortierung Groups mit static_name
2 participants