diff options
Diffstat (limited to 'app/finders/README.md')
-rw-r--r-- | app/finders/README.md | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/finders/README.md b/app/finders/README.md index 6fbf0e2f4c1..47823c51efb 100644 --- a/app/finders/README.md +++ b/app/finders/README.md @@ -3,7 +3,7 @@ This type of classes responsible for collectiong items based on different conditions. To prevent lookup methods in models like this: -``` +```ruby class Project def issues_for_user_filtered_by(user, filter) # A lot of logic not related to project model itself @@ -15,10 +15,8 @@ issues = project.issues_for_user_filtered_by(user, params) Better use this: -``` -selector = Finders::Issues.new - -issues = selector.execute(project, user, filter) +```ruby +issues = IssuesFinder.new.execute(project, user, filter) ``` It will help keep models thiner |