ish_models 0.0.33.188 → 0.0.33.190

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 +16 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5be06df7dd4e5ef757b2b41322b1dcb072a7e2e772aa62384b368d27d3e0e483
4
- data.tar.gz: 74b8d54e887100fd29150d9aa841d82bc851e2b9520704e9cacf5430fd381cd8
3
+ metadata.gz: d30c2589ea47b3dd3339a6ec79d263b0fe367fca764342cb70838397ce1996df
4
+ data.tar.gz: 94caf059572cc7ac3635b4e5cd262cb52053edbbc8263e8b61e1617c5f65c7c0
5
5
  SHA512:
6
- metadata.gz: 3cec2a4ac7f740f1ab7919962f2bd82ed6c185e676ec68befb66b811befd6e3b1f058772c714e993ad9deb85edc7e20ccfcab4769de511ac477fda7c657e88f1
7
- data.tar.gz: 792de38c42ca34ea13064540a39044fa05d994119840d1352ed2d50a7728d72c0c9a2101c73d1446bc5ccc31022b830b39887b7c2c76e01f393708a8097faa6b
6
+ metadata.gz: 31b95e22f45f825385566f8503a75d08676266b5b085516cd7894fdea2ed61deb247c555420aba28dd84a76e33b1e3a98fde3604460eca28d28600c8860a3a53
7
+ data.tar.gz: 9afb6134095e3b09001f5d49b515da6e069e6345e8edeb677c2a10d1bf0e9ab905def170459758d1a185a6dfac86d10f35f9bfe56300ebaa9bfc82d80fd58f0f
@@ -41,7 +41,7 @@ class Ish::EmailContext
41
41
  field :rendered_str
42
42
 
43
43
  field :sent_at, type: DateTime
44
- field :scheduled_at, type: DateTime
44
+ field :send_at, type: DateTime
45
45
 
46
46
  def self.all_campaigns
47
47
  Ish::EmailContext.where( type: TYPE_CAMPAIGN )
@@ -61,6 +61,21 @@ class Ish::EmailContext
61
61
  campaign_leads&.map { |p| p.lead }
62
62
  end
63
63
 
64
+ def self.unsent
65
+ new.unsent
66
+ end
67
+ def unsent
68
+ where( sent_at: nil )
69
+ end
70
+
71
+ def self.current
72
+ new.current
73
+ end
74
+ def current
75
+ # or({ :send_at.lte => Time.now }, { :send_at => nil }) ## This won't work b/c I need draft state!
76
+ where({ :send_at.lte => Time.now })
77
+ end
78
+
64
79
 
65
80
  ##
66
81
  ## For templating:
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.188
4
+ version: 0.0.33.190
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox