-
Notifications
You must be signed in to change notification settings - Fork 8
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
Connected groups as replacement for acts_as_dag #30
Open
fiedl
wants to merge
43
commits into
master
Choose a base branch
from
sf/connected_groups
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example: group1 |---- group2 --- group3 |---- event1 |------ attendees_group In the example, groups 1, 2, and 3 are connected groups. But the attendees_group is not connected to them, because a non-group object, event1, is in between.
…h is independent of the indirect DagLink objects.
This allows to find indirect memberships of groups.
This is because we do not want to consider officers of a group necessarily as members of the group. Trello: https://trello.com/c/wLS0CY6w/807-memberships-man-ist-ein-gruppen-mitgli ed-wenn-man-officer-attendee-oder-contactperson-ist
…pMemberships. Also, recalculate indirect memberships on creation of the direct ones. This makes all specs pass again.
This also required: 1. When finding memberships using a MembershipCollection, initialize the membership with the validity range. This saves time, since each membership does not need to fetch the validity range separately. 2. Fixing MembershipCollection#find_all_memberships_by_user_and_group to support also multiple memberships, for example when a user is a member in a group, leaves and rejoins later.
One has to use `Membership.where(…).uniq` rather than `Membership.where(…).to_a.uniq`, since the Array will compare the objects by their object id rather than their properties.
This method allows to create new memberships. membership = Membership.create(user: u, group: g) membership = Membership.create(user: u, group: g, valid_from: 1.month_ago, valid_to: 1.day.ago)
…alization. We need this when modifying the validity range through forms.
This only works for direct memberships and directly refers to the id of the corresponding DagLink.
There has been an issue where the wrong group has been associated with the membership.
…n memberships are regarded as resources.
…d behaviour Now, a `Membership` is built rather than a `UserGroupMembership :< DagLink`.
I thought, I would use this for group_members#index. But it turns out, this dos not result in the expected behaviour. In a super group, rather than seeing the date of joining the current direct group, I want to see when the user joined one of the direct groups the first time.
…ges_of_indirect_memberships. This joins indirect memberships when they are of the same user and the same group but different validity ranges: |-----------| first indirect membership in @Group1 |--------- second indirect membership in @Group2 |--------------------- joined indirect membership This is needed, since in `group_members#index` of indirect groups, the users should be listed only once. They should be listed with the earliest valid_from of the direct memberships. It’s not enough to use `MembershipCollection#first_per_group`, because this would only consider current direct memberships.
…he new mechanism. This includes interface changes, since `User#groups` is now an `Array`, not an Association. This only affects write access.
…ism. `Group#members` now returns a `MemberCollection`.
…roup: …) Despite the primary cache scope, we need the user and the group in the cache key, since Membership.where(…) can specify both, user and group.
as shortcut for Array#map&. This will come in Rails 5.
Only direct dag links are stored in the database as of this commit.
Implementing `Structureable#affected_nodes_after_officer_has_changed`. This is needed for refreshing the cache of affected nodes when a part of the graph changes.
2015-eil4tohK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Internal documentation:
This work has been abandoned.