Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2014-03-19 04:05:10 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-24 17:00:01 +0400
commita87f03768f87c3ebe62b7aaf94380eb56239bd4e (patch)
tree1c817a9ec47bb38ebebec23ebfbf0ab84c8d73d4 /app/finders
parentd66d10970d2dcd4a6be0de6fef2274e4eefa5657 (diff)
Fix deprecation warning output
Removes the following from test output: DEPRECATION WARNING: It looks like you are eager loading table(s) (one of: merge_requests, projects) that are referenced in a string SQL snippet. For example: Post.includes(:comments).where("comments.title = 'foo'") Currently, Active Record recognizes the table in the string, and knows to JOIN the comments table to the query, rather than loading comments in a separate query. However, doing this without writing a full-blown SQL parser is inherently flawed. Since we don't want to write an SQL parser, we are removing this functionality. From now on, you must explicitly tell Active Record when you are referencing a table from a string: Post.includes(:comments).where("comments.title = 'foo'").references(:comments) If you don't rely on implicit join references you can disable the feature entirely by setting `config.active_record.disable_implicit_join_references = true`.
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/base_finder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/base_finder.rb b/app/finders/base_finder.rb
index d20716fb170..7fc5840561c 100644
--- a/app/finders/base_finder.rb
+++ b/app/finders/base_finder.rb
@@ -47,9 +47,9 @@ class BaseFinder
[]
end
elsif current_user && params[:authorized_only].presence
- klass.of_projects(current_user.authorized_projects)
+ klass.of_projects(current_user.authorized_projects).references(:project)
else
- klass.of_projects(Project.accessible_to(current_user))
+ klass.of_projects(Project.accessible_to(current_user)).references(:project)
end
end