mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-18 00:56:41 +10:00
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/controllers/autocomplete_controller.rb app/controllers/omniauth_callbacks_controller.rb app/controllers/projects/services_controller.rb app/helpers/projects_helper.rb app/services/audit_event_service.rb db/schema.rb doc/api/users.md doc/update/6.x-or-7.x-to-7.13.md features/project/project.feature
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(project, user, filter).execute
It will help keep models thiner.