-
- Downloads
Refactoed GroupsFinder into two separate classes
In the previous setup the GroupsFinder class had two distinct tasks: 1. Finding the projects user A could see 2. Finding the projects of user A that user B could see Task two was actually handled outside of the GroupsFinder (in the UsersController) by restricting the returned list of groups to those the viewed user was a member of. Moving all this logic into a single finder proved to be far too complex and confusing, hence there are now two finders: * GroupsFinder: for finding groups a user can see * JoinedGroupsFinder: for finding groups that user A is a member of, restricted to either public groups or groups user B can also see.
Showing
- app/finders/groups_finder.rb 37 additions, 32 deletionsapp/finders/groups_finder.rb
- app/finders/joined_groups_finder.rb 49 additions, 0 deletionsapp/finders/joined_groups_finder.rb
- spec/finders/groups_finder_spec.rb 42 additions, 9 deletionsspec/finders/groups_finder_spec.rb
- spec/finders/joined_groups_finder_spec.rb 49 additions, 0 deletionsspec/finders/joined_groups_finder_spec.rb
app/finders/joined_groups_finder.rb
0 → 100644
spec/finders/joined_groups_finder_spec.rb
0 → 100644
Please register or sign in to comment