Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-25 21:15:08 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-25 21:15:08 +0400
commit645e8d470559b07a22164c55b76195a60fb8b37b (patch)
treed77b7a795c0bf503586e1e704064432e2df96c0b /app/finders/README.md
parent0f473674920dfc6759ddf131b32eb0b4b06256d0 (diff)
Move services for collecting items to Finders
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/finders/README.md')
-rw-r--r--app/finders/README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/finders/README.md b/app/finders/README.md
new file mode 100644
index 00000000000..6fbf0e2f4c1
--- /dev/null
+++ b/app/finders/README.md
@@ -0,0 +1,24 @@
+# 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:
+
+```
+selector = Finders::Issues.new
+
+issues = selector.execute(project, user, filter)
+```
+
+It will help keep models thiner