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

PEOPLE: Geschwister in Abteilung als computed value #289

Merged
merged 17 commits into from
Dec 11, 2023

Conversation

diegosteiner
Copy link
Contributor

@diegosteiner diegosteiner commented Sep 12, 2023

@diegosteiner diegosteiner changed the title ]#2147 siblings in layer [WIP] PEOPLE: Geschwister in Abteilung als computed value Sep 12, 2023
@@ -20,10 +20,18 @@ def roles_grouped
end
end

def siblings_in_context(context)
family_member_finder.family_members_in_context(context, kind: :sibling)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ich habe die Logik in einen abgekapselten Service verschoben, weil sie doch an einigen verschiedenen Orten gebraucht wird und so einfacher getestet werden kann.

@diegosteiner diegosteiner changed the title [WIP] PEOPLE: Geschwister in Abteilung als computed value PEOPLE: Geschwister in Abteilung als computed value Sep 14, 2023
@diegosteiner diegosteiner force-pushed the #2147_siblings-in-layer branch from ebfac4c to a1e49ea Compare September 21, 2023 12:52
Copy link
Member

@carlobeltrame carlobeltrame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logik sieht solide aus, merci vielmals! Habe nur sehr kleine stilistische Änderungen. Ich teste es dann mal noch bei Gelegenheit von Hand durch, wir könnens eh erst ab dem 17. Oktober mergen.

Comment on lines 13 to 32
def family_members_in_layer(group, kind: :sibling)
Role.joins(person: :family_members)
.where(group: group.groups_in_same_layer,
person: { family_members: { kind: kind, other: person } })
end

def family_members_in_event(event, kind: :sibling)
Event::Participation.joins(person: :family_members)
.where(person: { family_members: { kind: kind, other: person } },
event: event)
end

def family_members_in_context(context, kind: :sibling)
case context
when Event
family_members_in_event(context, kind: kind)
when Group
family_members_in_layer(context, kind: kind)
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation ist hier zwei Spaces zu weit gerutscht

app/domain/person/family_member_finder.rb Outdated Show resolved Hide resolved
@carlobeltrame carlobeltrame linked an issue Nov 24, 2023 that may be closed by this pull request
31 tasks
@TheWalkingLeek TheWalkingLeek force-pushed the #2147_siblings-in-layer branch from bee82ff to 16e03cf Compare December 11, 2023 11:53
@TheWalkingLeek
Copy link
Member

Nice merci! Hab noch die Indentation gefixt und rebased :)

@TheWalkingLeek TheWalkingLeek merged commit 9fea7ed into master Dec 11, 2023
5 checks passed
@TheWalkingLeek TheWalkingLeek deleted the #2147_siblings-in-layer branch December 11, 2023 12:14
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.

PEOPLE: Geschwister in Abteilung als computed value
4 participants