Commit 609e37e4844d2b10a65b9e5bb6aeae22e78d7f9a
Committed by
Daniel
1 parent
0b31911b
Exists in
master
and in
28 other branches
add doc comment to ScopeTool
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
lib/scope_tool.rb
1 | 1 | module ScopeTool |
2 | 2 | |
3 | + # Sum scope results by SQL, allowing post filtering of the group. | |
3 | 4 | def union(*scopes) |
4 | 5 | model = scopes.first.class_name.constantize |
5 | 6 | scopes = scopes.map &:to_sql |
... | ... | @@ -7,6 +8,7 @@ module ScopeTool |
7 | 8 | end |
8 | 9 | |
9 | 10 | class << self |
11 | + # Allows to use `ScopeTool.method()` anywhere. | |
10 | 12 | include ScopeTool |
11 | 13 | end |
12 | 14 | ... | ... |