gitlab-org--gitlab-foss/app/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
..
ci Merge branch 'rename-ci-commit-phase-4' into 'master' 2016-06-10 14:31:21 +00:00
concerns Fix pseudo n+1 queries with Note and Note Authors in issuables APIs 2016-06-08 10:26:05 -04:00
hooks Merge branch 'hook-docs-behavior' into 'master' 2016-05-11 16:34:00 +00:00
members Add changelog and code refactor 2016-05-30 22:32:07 +07:00
network Merge branch 'style/enable-semicolon-rubocop-cop' into 'master' 2016-06-01 17:41:19 +00:00
project_services Enable Lint/AmbiguousOperator rubocop cop 2016-06-03 10:59:43 +02:00
.gitkeep
ability.rb Merge branch 'separate-banzai-references' into 'master' 2016-06-01 15:51:59 +00:00
abuse_report.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
appearance.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
application_setting.rb Allow custom text on 'almost there' page 2016-06-08 19:08:53 +01:00
audit_event.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
award_emoji.rb Fix latests concerns 2016-05-18 08:47:15 -05:00
blob.rb Properly handle bigger files 2016-04-28 21:28:39 +02:00
broadcast_message.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
commit.rb Remove projects inclusion in notes_with_associations to skip some unnecessary queries 2016-06-08 10:26:05 -04:00
commit_range.rb Don't modify arguments in CommitRange#initialize 2016-05-26 13:58:01 +02:00
commit_status.rb Delegate to pipeline instead of commit 2016-06-03 13:34:38 +02:00
deploy_key.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
deploy_keys_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
email.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
event.rb Reduce duplication and branching logic in EventsHelper 2016-05-16 14:52:04 -05:00
external_issue.rb Merge branch 'master' into number_sign_for_external_issue_ref 2016-04-17 18:17:27 +02:00
forked_project_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
generic_commit_status.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
global_label.rb Updates from last code review. 2016-03-06 23:07:19 -05:00
global_milestone.rb Ruby fixes 2016-03-29 12:19:09 +01:00
group.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
identity.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
issue.rb Improve Issuable.order_labels_priority 2016-06-06 11:59:49 -05:00
jira_issue.rb Backport JIRA service 2015-12-18 14:19:48 -06:00
key.rb Add leading comment space cop 2016-05-31 19:33:46 -03:00
label.rb Fix label order by priority on labels page 2016-06-07 14:01:30 +01:00
label_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
legacy_diff_note.rb Incorportate feedback 2016-06-01 12:10:08 +02:00
lfs_object.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
lfs_objects_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
member.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
merge_request.rb Remove unused MergeRequest#gitlab_merge_status method 2016-06-10 18:42:03 +02:00
merge_request_diff.rb Maintain commit order in MRs 2016-05-18 17:14:55 +01:00
milestone.rb Address Yorick's feedback 2016-05-18 23:45:25 -05:00
namespace.rb Merge branch 'docker-registry' into docker-registry-view 2016-05-13 17:15:01 -05:00
note.rb Backend awardables on comments 2016-06-06 11:03:39 +02:00
notification_setting.rb Notifications dropdown on project page now has descriptions 2016-06-07 15:02:00 +01:00
oauth_access_token.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
personal_snippet.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
project.rb Merge branch 'finding-multiple-projects-by-paths' into 'master' 2016-06-10 17:17:19 +00:00
project_group_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
project_import_data.rb Upgrade attr_encrypted and encryptor 2016-05-30 13:51:21 -06:00
project_snippet.rb Refactor Participable 2016-06-01 16:22:35 +02:00
project_team.rb Allow users to access project shared with their group 2016-03-11 18:46:01 +01:00
project_wiki.rb Codestyle changes 2016-05-31 11:24:58 -03:00
protected_branch.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
release.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
repository.rb Remove main_language and tests 2016-05-25 17:16:42 -04:00
security_event.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
sent_notification.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
service.rb Cache the presence of an issue_tracker at project level 2016-06-10 15:41:56 +02:00
snippet.rb Remove projects inclusion in notes_with_associations to skip some unnecessary queries 2016-06-08 10:26:05 -04:00
spam_log.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
spam_report.rb Support Akismet spam checking for creation of issues via API 2016-02-02 11:25:44 -02:00
subscription.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
todo.rb Create a todo on failing MR build 2016-05-17 10:17:45 +01:00
tree.rb Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into lazy-blobs 2016-02-01 13:51:05 +01:00
u2f_registration.rb Add a U2fRegistrations table/model. 2016-06-06 12:50:31 +05:30
user.rb Add a U2fRegistrations table/model. 2016-06-06 12:50:31 +05:30
users_star_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
wiki_page.rb add slack notifications for wiki pages 2016-04-20 08:25:40 +08:00