ish_models 0.0.33.184 → 0.0.33.185

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: 3e6eff98102df0e1c876a6efbead562210b0d6863d9a75574aef191c778a011b
4
- data.tar.gz: 5a5b1eaab82f0ccb24304b8ee61821504c3940e8cca6e54ef4ec161c5394dc7d
3
+ metadata.gz: 85b9a6758d41c84ed2393951c0e8bd9733d92f745859689e64940677205962bf
4
+ data.tar.gz: 4133474740d173f9eddc0339a2c8fcc2b335a199db36f2f19cc813afe2889594
5
5
  SHA512:
6
- metadata.gz: d35fb3fc9226c8720e083090b86bca77399bfa62a99cc4c1e3650688a25a4f9f9ab1dc59c825f258f6e25016cf7c5fafb6b223d1b16553555858783b9b7c11f2
7
- data.tar.gz: af86d30206881902dc9654d38a903f6b1a7fbd41f81c1719b959478ddcf2ab691ae03d83edbec538098137bc4812427ab3d08326052fc4da4821f426ef878025
6
+ metadata.gz: 4139e2903f034633a246aa43217b5f7eb64f3a5ec475774633d28b97984da2b35fa5ec4fde1ec4798b6c04f49c855db258df812f9dcb1e18e069326886d58031
7
+ data.tar.gz: 2ce2bed1e8a34efa83e643de5277561c3bc804503c5f6c293e72025ba639fc3b489eebd6d21296fe8d4598f1401bf9387d7fcfa21c686b30b3ed0e4c54a4d3c1
@@ -8,6 +8,9 @@ class Ish::EmailContext
8
8
  include Mongoid::Timestamps
9
9
 
10
10
  field :title
11
+ def slug
12
+ title
13
+ end
11
14
 
12
15
  PAGE_PARAM_NAME = 'email_contexts_page'
13
16
 
@@ -39,12 +42,20 @@ class Ish::EmailContext
39
42
  field :sent_at, type: DateTime
40
43
  field :scheduled_at, type: DateTime
41
44
 
42
- def leads
45
+ def self.all_campaigns
46
+ Ish::EmailContext.where( type: TYPE_CAMPAIGN )
47
+ end
48
+
49
+ def campaign_leads
43
50
  if self.type == TYPE_CAMPAIGN
44
- return ::EmailCampaignLead.where( email_campaign_id: self.id.to_s ).includes( :lead ).map { |p| p.lead }
51
+ return ::EmailCampaignLead.where( email_campaign_id: self.id.to_s ).includes( :lead )
45
52
  end
46
53
  end
47
54
 
55
+ def leads
56
+ campaign_leads&.map { |p| p.lead }
57
+ end
58
+
48
59
 
49
60
  #
50
61
  # For templating:
@@ -60,4 +71,4 @@ class Ish::EmailContext
60
71
  attr_reader :tid
61
72
 
62
73
  end
63
- EmailContext = Ish::EmailContext
74
+ EmailCampaign = Ish::EmailContext
File without changes
File without changes
data/lib/ish_models.rb CHANGED
@@ -44,7 +44,6 @@ require 'gameui/premium_purchase'
44
44
 
45
45
  require 'ish/cache_key'
46
46
  require 'ish/crawler'
47
- # require 'ish/email_campaign' ## context + leadset is a campaign.
48
47
  require 'ish/email_context'
49
48
  require 'ish/email_template'
50
49
  require 'ish/email_unsubscribe'
@@ -52,8 +51,6 @@ require 'ish/gallery_name'
52
51
  require 'ish/image_asset'
53
52
  require 'ish/input_error'
54
53
  require 'ish/invoice'
55
- require 'ish/issue'
56
- require 'ish/lead'
57
54
  require 'ish/lorem_ipsum'
58
55
  require 'ish/meeting'
59
56
  require 'ish/payment'
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.184
4
+ version: 0.0.33.185
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -132,15 +132,14 @@ files:
132
132
  - lib/ish/image_asset.rb
133
133
  - lib/ish/input_error.rb
134
134
  - lib/ish/invoice.rb
135
- - lib/ish/issue.rb
136
- - lib/ish/lead.rb
137
- - lib/ish/lead.rb-bk
138
135
  - lib/ish/lorem_ipsum.rb
139
136
  - lib/ish/meeting.rb
140
137
  - lib/ish/payment.rb
141
138
  - lib/ish/premium_item.rb
142
139
  - lib/ish/railtie.rb
143
140
  - lib/ish/trash/email_campaign.rb
141
+ - lib/ish/trash/lead.rb
142
+ - lib/ish/trash/lead.rb-bk
144
143
  - lib/ish/user_profile.rb
145
144
  - lib/ish/utils.rb
146
145
  - lib/ish_models.rb
data/lib/ish/issue.rb DELETED
@@ -1,14 +0,0 @@
1
-
2
- #
3
- # Issue
4
- # _vp_ 20171204
5
- #
6
- class Ish::Issue
7
- include Mongoid::Document
8
- include Mongoid::Timestamps
9
-
10
- store_in :collection => 'ish_issue'
11
-
12
- field :name
13
-
14
- end