Set inverse_of for Project/Services relation
What does this MR do?
This MR adds the inverse_of:
option to two associations to reduce the number of queries when running code such as project.gitlab_issue_tracker_service.project
.
Are there points in the code the reviewer needs to double check?
No.
Why was this MR needed?
In !4410 (merged) it was revealed code such as the above is used and would run SQL queries when the root object (usually a Project) was already present. By using inverse_of
Rails can just re-use those Project instances.
What are the relevant issue numbers?
None.
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added -
Tests -
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together