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 +4 -4
- data/lib/ish/email_context.rb +26 -7
- data/lib/ish/{lead.rb → trash/lead.rb} +0 -0
- data/lib/ish/{lead.rb-bk → trash/lead.rb-bk} +0 -0
- data/lib/ish/user_profile.rb +0 -1
- data/lib/ish_models.rb +0 -3
- metadata +3 -4
- data/lib/ish/issue.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d027fcc8d0c98d5575e517250768051102853dc5615027fe2c9179d040c77d6f
|
4
|
+
data.tar.gz: b4de385ed7e98ba1903726b618d5de6ce5c4c0f032f8d0364ae3b306790f36f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202b110ebedc34cc0ae916459fe309f6641674d92c3230585f0d1d68fdeb2aa490820c8be1537f872811c87bd74ea47d1a3a089cede0bc2b1d634a397a22f743
|
7
|
+
data.tar.gz: afc8efc356d678c9f5bce359bca29327df0070a4969a920168cdc1f348c39c5e8fbec35f99758005b88e4bc8835d53b1a881cc7d7f9c00c556d9d62bfc180b0c
|
data/lib/ish/email_context.rb
CHANGED
@@ -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
|
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 )
|
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
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
82
|
+
EmailCampaign = Ish::EmailContext
|
File without changes
|
File without changes
|
data/lib/ish/user_profile.rb
CHANGED
@@ -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.
|
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
|