ish_models 0.0.33.236 → 0.0.33.238

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c580722d18c96031a011c7ea79b1a450e5b7cb721c593c4883197b177a268910
4
- data.tar.gz: 57d131d15cc10bc3292bdb4af381de8f71b6ce6bbfa5ff526cf34563110b6dbb
3
+ metadata.gz: e1c960b6372f0929c516cc3482738977e2d4b1d8c5ef5c63d27d257c12bfe422
4
+ data.tar.gz: 79971a45405a9c29abb69e8d266dca223a29b4a82a87704b17d548e3123af1eb
5
5
  SHA512:
6
- metadata.gz: 4773cc9026faf169a7a50f92e6cb82119265644e56a54a0e4d65e7d403944b391583089be21e6185e14130330f0dae41c2eb1b943dd3d7c95c6eb81e7b759252
7
- data.tar.gz: 123104d4cd0fafb595aeb15d291f6cc38285b0db5cd50fe8669d0403cebf8162425c2ae8d7507a6f708c8daf24e2a1504cfb278e25cfd988284d7a69802da979
6
+ metadata.gz: 4f6e88e54a2ee9b656f7e90b5234359c44a4b20a433444090305169810dba8ef919941987430098e5dff11250e0e69f62adeaef40f38f986378bbab752643fc5
7
+ data.tar.gz: a606173a1f1337dcda0efd7a0cf3bfa7a7c171edceaa344b9950a8cba52c215e016c0147aab2ecfe9d7ca359936f48a5beb57197c8037051753dc6014d52bf45
@@ -33,7 +33,9 @@ class ::Ish::EmailContext
33
33
  # validates_presence_of :from_email
34
34
 
35
35
  field :subject
36
- # validates_presence_of :subject
36
+ def subject
37
+ self[:subject].presence || tmpl.subject
38
+ end
37
39
 
38
40
  belongs_to :email_template
39
41
  def tmpl; email_template; end
@@ -85,7 +87,8 @@ class ::Ish::EmailContext
85
87
  pipeline = [
86
88
  { '$group' => {
87
89
  '_id' => { '$dateToString' => { 'format' => "%Y-%m-%d", 'date' => "$sent_at" } }, 'total' => { '$sum' => 1 }
88
- } }
90
+ } },
91
+ { '$sort' => { '_id': -1 } },
89
92
  ]
90
93
  outs = Ish::EmailContext.collection.aggregate( pipeline )
91
94
  outs.to_a
@@ -12,7 +12,7 @@ class ::Ish::EmailTemplate
12
12
  field :layout, type: :string, default: 'plain'
13
13
  LAYOUTS = %w| plain
14
14
  m20221201react m20221222merryxmas
15
- marketing_react_1
15
+ marketing_react_1 marketing_react_2
16
16
  marketing_ror_1 marketing_ror_2
17
17
  marketing_wordpres_1 marketing_wordpress_2
18
18
  piousbox_roundborders
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.236
4
+ version: 0.0.33.238
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox