Commit Graph

8 Commits

Author SHA1 Message Date
Nick Thomas 013f7cd24c
Inherit from ApplicationRecord instead of ActiveRecord::Base 2019-03-28 16:18:23 +00:00
gfyoung 50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Yorick Peterse 6f292eaa69
Revert the addition of goldiloader
This reverts the addition of the "goldiloader" Gem and all use of it.
While this Gem is very promising it's causing a variety of problems on
GitLab.com due to it eager-loading too much data in places where we
don't expect/can handle this. At least for the time being this means we
have to go back to manually fixing N+1 query problems, but at least
those should not cause a negative impact on availability.
2018-04-18 15:51:39 +02:00
Sean McGivern 4ef3e3491e Add cop for has_many :through without disabled autoloading
Goldiloader is great, but has several issues with has_many :through relations:

* https://github.com/salsify/goldiloader/issues/12
* https://github.com/salsify/goldiloader/issues/14
* https://github.com/salsify/goldiloader/issues/18

Rather than try to figure out which applies in each case, we should just do the
drudge work of manually disabling autoloading for all relations of this type. We
can always use regular preloading for specific cases, but this way we avoid
generating invalid queries through Goldiloader's magic.
2018-04-09 12:47:04 +01:00
Bob Van Landuyt 7582bc8b4e Unlink a project from a fork network when it's source was deleted.
We need to close all merge requests coming from the project within the
entire fork network.
2017-11-03 12:17:59 +01:00
Bob Van Landuyt f90b27da77 Find forks within users/namespaces using fork memberships 2017-10-07 11:46:23 +02:00
Bob Van Landuyt d328007214 Create a fork network when forking a project
When no fork network exists for the source projects, we create a new
one with the correct source
2017-10-07 11:46:23 +02:00
Bob Van Landuyt 20727db170 Add a model for `fork_networks`
The fork network will keep track of the root project as long as it's
present.
2017-10-07 11:46:22 +02:00