gitlab-org--gitlab-foss/app/finders
Robert Speicher a87f03768f 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`.
2014-03-24 15:00:01 +02:00
..
base_finder.rb Fix deprecation warning output 2014-03-24 15:00:01 +02:00
issues_finder.rb Move services for collecting items to Finders 2014-02-25 19:15:08 +02:00
merge_requests_finder.rb Move services for collecting items to Finders 2014-02-25 19:15:08 +02:00
notes_finder.rb Move services for collecting items to Finders 2014-02-25 19:15:08 +02:00
projects_finder.rb Move services for collecting items to Finders 2014-02-25 19:15:08 +02:00
README.md Update tests and fix Finders readme 2014-02-25 19:21:53 +02:00

Finders

This type of classes responsible for collectiong items based on different conditions. To prevent lookup methods in models like this:

class Project
  def issues_for_user_filtered_by(user, filter)
    # A lot of logic not related to project model itself
  end
end

issues = project.issues_for_user_filtered_by(user, params)

Better use this:

issues = IssuesFinder.new.execute(project, user, filter)

It will help keep models thiner