Disallow usage of `ActiveRecord::Associations::Association#reload`
Description of the proposal
It seems that usage of ActiveRecord::Associations::Association#reload
has very nasty side effects:
it makes to preload all objects. In this example, it resulted in O(n)
complexity of worker:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27121.
Instead of #reload
it seems that #reset
could be used to achieve the same effect: refresh the state of association.
Where it is not possible we would introduce alias_method :reset, :reload
.
-
Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution -
Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are 👍 -
Once approved, mention it again in the next backend weekly call and the #backend channel
Edited by Kamil Trzciński