ish_models 0.0.33.234 → 0.0.33.235
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/email_context.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8002a35421fc69935dc8771ead9c2c766d4506d1d1117bd3bd9890060c3c081b
|
4
|
+
data.tar.gz: 60c9c0e509691481bc9cf385549d74434d407a278fea83944f1c4f867a488ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3d523e5af0f2bef36d7fdaf20dc28d7698298be5f8a6f380011bbfb8ec5d5d625ffb4d447b75c7fb91384bda78f6580945fe0c4f307b0656176f6fe74bc0a6e
|
7
|
+
data.tar.gz: 02e270850e4dfa21c2e23a6d033cc80650b9cc4bd20d6cc5f6b4e2df19a7d1c748746275cc7876c9e94068845161cd576b1980d8a9e9b37aff00c6b40b048cab
|
data/lib/ish/email_context.rb
CHANGED
@@ -35,8 +35,6 @@ class ::Ish::EmailContext
|
|
35
35
|
field :subject
|
36
36
|
# validates_presence_of :subject
|
37
37
|
|
38
|
-
|
39
|
-
|
40
38
|
belongs_to :email_template
|
41
39
|
def tmpl; email_template; end
|
42
40
|
|
@@ -83,6 +81,16 @@ class ::Ish::EmailContext
|
|
83
81
|
binding()
|
84
82
|
end
|
85
83
|
|
84
|
+
def self.summary
|
85
|
+
pipeline = [
|
86
|
+
{ '$group' => {
|
87
|
+
'_id' => { '$dateToString' => { 'format' => "%Y-%m-%d", 'date' => "$sent_at" } }, 'total' => { '$sum' => 1 }
|
88
|
+
} }
|
89
|
+
]
|
90
|
+
outs = Ish::EmailContext.collection.aggregate( pipeline )
|
91
|
+
outs.to_a
|
92
|
+
end
|
93
|
+
|
86
94
|
end
|
87
95
|
Ctx = ::Ish::EmailContext
|
88
96
|
|