ish_models 0.0.33.184 → 0.0.33.186

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: d027fcc8d0c98d5575e517250768051102853dc5615027fe2c9179d040c77d6f
4
+ data.tar.gz: b4de385ed7e98ba1903726b618d5de6ce5c4c0f032f8d0364ae3b306790f36f9
5
5
  SHA512:
6
- metadata.gz: d35fb3fc9226c8720e083090b86bca77399bfa62a99cc4c1e3650688a25a4f9f9ab1dc59c825f258f6e25016cf7c5fafb6b223d1b16553555858783b9b7c11f2
7
- data.tar.gz: af86d30206881902dc9654d38a903f6b1a7fbd41f81c1719b959478ddcf2ab691ae03d83edbec538098137bc4812427ab3d08326052fc4da4821f426ef878025
6
+ metadata.gz: 202b110ebedc34cc0ae916459fe309f6641674d92c3230585f0d1d68fdeb2aa490820c8be1537f872811c87bd74ea47d1a3a089cede0bc2b1d634a397a22f743
7
+ data.tar.gz: afc8efc356d678c9f5bce359bca29327df0070a4969a920168cdc1f348c39c5e8fbec35f99758005b88e4bc8835d53b1a881cc7d7f9c00c556d9d62bfc180b0c
@@ -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,17 +42,33 @@ 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
48
58
 
49
- #
50
- # For templating:
51
- #
52
- field :tmpl_name
59
+
60
+ ##
61
+ ## For templating:
62
+ ##
63
+ ## commonly: name, companyName
64
+ field :tmpl, type: Hash, default: {}
65
+ def body_templated
66
+ out = email_template.body
67
+ tmpl.each do |k, v|
68
+ out.gsub!("{#{k}}", v)
69
+ end
70
+ out
71
+ end
53
72
 
54
73
  field :to_email
55
74
  validates_presence_of :to_email, if: -> { type == TYPE_SINGLE }
@@ -60,4 +79,4 @@ class Ish::EmailContext
60
79
  attr_reader :tid
61
80
 
62
81
  end
63
- EmailContext = Ish::EmailContext
82
+ EmailCampaign = Ish::EmailContext
File without changes
File without changes
@@ -54,7 +54,6 @@ class Ish::UserProfile
54
54
  has_many :my_maps, :inverse_of => :creator_profile, class_name: 'Gameui::Map'
55
55
 
56
56
  has_many :invoices, :class_name => '::Ish::Invoice'
57
- has_many :leads, :class_name => '::Ish::Lead'
58
57
  has_many :photos
59
58
  has_many :reports, inverse_of: :user_profile
60
59
 
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.186
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