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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ish/email_context.rb +10 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c464ecbe4a61f85fa19d1c9ec66fd1dcb1ee0eaa9f6424134ceee290805365c5
4
- data.tar.gz: 8297a2bd06cf105488be78d1d482df3f3006f3f0234459d6f412bceeb74b4b58
3
+ metadata.gz: 8002a35421fc69935dc8771ead9c2c766d4506d1d1117bd3bd9890060c3c081b
4
+ data.tar.gz: 60c9c0e509691481bc9cf385549d74434d407a278fea83944f1c4f867a488ffa
5
5
  SHA512:
6
- metadata.gz: '098aa43e8985e69a1262511558387fdce8706ee2a436eef7e6333267784df53244b2afccedca4dddb824fc128378bb3135f29a6960a1315ed730b1b125bb6980'
7
- data.tar.gz: b0cbd47c59442398d617c843bdcd855a18ce0cf5b2f85cfce0933d90da53505d688a0ba4b1fe1ec8abbe923fda834164053ca1bf4500f77376d1d7a25b54b5ac
6
+ metadata.gz: e3d523e5af0f2bef36d7fdaf20dc28d7698298be5f8a6f380011bbfb8ec5d5d625ffb4d447b75c7fb91384bda78f6580945fe0c4f307b0656176f6fe74bc0a6e
7
+ data.tar.gz: 02e270850e4dfa21c2e23a6d033cc80650b9cc4bd20d6cc5f6b4e2df19a7d1c748746275cc7876c9e94068845161cd576b1980d8a9e9b37aff00c6b40b048cab
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.234
4
+ version: 0.0.33.235
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox