Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter project enrollments and households by assigned staff (#4582)
* Add staff assignment DB tables and begin schema * Add staff assignment pick lists * Add mutations and spec * Add arg to query for historical assignments * Pairing and PR feedback * Remove fk constraint on staff assignment user * PR response for pick list options * remove wip comment * remove comment * Fix failing tests * Make duplicate assignment a user-resolvable error * Attach error to user_id, not base * quick fix to permission_for scope to cut dupes * Improvements per frontend * Remove comment * Use viewable_by and don't preload in assign_staff Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Lock to avoid race condition; call create! instead of new Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Move return of assignment inside lock block * Mirror user scope in assignment to user picklist Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Fix test by adding access control * Use input type for staff assignment mutation * Improve staff assignment table indices Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Alphabetize staff user picklist by last,first * Simplify unassignment to use find instead of find_by * Use sequence in staff assignment factory Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Use id rather than deleted_at as tiebreaker Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Fix tests * standardize on current_permission Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Sketch contains_with_inherited scope * Fix permissions * Add query for staff assignments by user * Remove extraneous ?? * Filter project enrollments and households by assigned staff * Remove unhelpful use of data loader Co-authored-by: Theron Toomey <ttoomey@greenriver.org> * Use composition for arel helper * Fix bad merge * staff assignments performance improvement skip join to households as it's not performant right now * Add back n+1 comment still relevant --------- Co-authored-by: Theron Toomey <ttoomey@greenriver.org>
- Loading branch information