Files
gitlabhq/spec/models
Robert Speicher b4e84809e8 Merge branch 'finding-multiple-projects-by-paths' into 'master'
Add Project.where_paths_in

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4410 I'm working on reducing the SQL queries needed to render Markdown. One reason for the large amount of queries is executing a large number of queries needed to find projects and related data. Basically `Project.find_with_namespace` is called in a loop and then any relations have to be retrieved separately.

By using `Project.where_paths_in` we can work around this by doing something like:

```ruby
project_paths = [...] # populated by some method
projects = Project.where_paths_in(project_paths).includes(:namespace, ...)
```

Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/18042

See merge request !4535
2016-06-10 17:17:19 +00:00
..
2016-05-21 23:11:26 +07:00
2016-06-01 16:22:35 +02:00
2016-06-01 12:10:08 +02:00
2016-06-01 16:22:35 +02:00
2015-12-18 14:19:48 -06:00
2016-05-29 15:03:00 -04:00
2016-05-16 18:03:55 -05:00
2016-06-06 11:03:39 +02:00
2016-03-20 22:55:08 +01:00
2016-06-01 16:22:35 +02:00