mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-20 01:56:06 +10:00
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/controllers/projects/services_controller.rb app/models/concerns/mentionable.rb app/models/project.rb app/models/user.rb app/views/admin/users/index.html.haml app/views/projects/services/_form.html.haml config/gitlab.yml.example config/initializers/1_settings.rb lib/gitlab/git_access.rb lib/gitlab/ldap/access.rb lib/gitlab/ldap/person.rb lib/gitlab/reference_extractor.rb spec/lib/gitlab/ldap/access_spec.rb
Finders
This type of classes responsible for collection 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.