Commit a87f03768f87c3ebe62b7aaf94380eb56239bd4e

Authored by Robert Speicher
Committed by Dmitriy Zaporozhets
1 parent d66d1097

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`.
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/finders/base_finder.rb
... ... @@ -47,9 +47,9 @@ class BaseFinder
47 47 []
48 48 end
49 49 elsif current_user && params[:authorized_only].presence
50   - klass.of_projects(current_user.authorized_projects)
  50 + klass.of_projects(current_user.authorized_projects).references(:project)
51 51 else
52   - klass.of_projects(Project.accessible_to(current_user))
  52 + klass.of_projects(Project.accessible_to(current_user)).references(:project)
53 53 end
54 54 end
55 55  
... ...