ish_models 0.0.33.211 → 0.0.33.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ish/email_context.rb +4 -1
- data/lib/ish_models.rb +1 -0
- data/lib/office/email_action.rb +13 -8
- data/lib/office/email_action_tie.rb +37 -0
- data/lib/office/scheduled_email_action.rb +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f038ff1851957b2b2d8ec01c3ab51af9a21878edbfa61c4dfda2df664b126f4
|
4
|
+
data.tar.gz: 4c682ece15b9bfa0a02e7edea7c3916ee840da82c90049d2c5755e8323c9595a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7867b58c47db3b1297144df58a51eacfd9c203f5af415028e4908223f76a480743dee435a58fbdf78963b2b595c8d01199f1140fb622cca9695a81a118d43c91
|
7
|
+
data.tar.gz: 9610d87986bf78a8fac233ea83d2fe428e995e2a62105f909ff22775b71808b27ae8e8e1382fd09e367e792e18eb8d67af6665588186a0b827b5747aa161811f
|
data/lib/ish/email_context.rb
CHANGED
@@ -11,7 +11,7 @@ class ::Ish::EmailContext
|
|
11
11
|
|
12
12
|
field :preview_str, type: :string
|
13
13
|
def preview_str
|
14
|
-
if self[:preview_str].presence
|
14
|
+
if self[:preview_str].presence
|
15
15
|
return self[:preview_str]
|
16
16
|
else
|
17
17
|
return tmpl.preview_str
|
@@ -49,6 +49,9 @@ class ::Ish::EmailContext
|
|
49
49
|
Ish::EmailContext.where({ :send_at.lte => Time.now })
|
50
50
|
end
|
51
51
|
|
52
|
+
def self.from_email_list
|
53
|
+
Ish::EmailCampaign.from_email_list
|
54
|
+
end
|
52
55
|
|
53
56
|
field :lead_id, type: :integer
|
54
57
|
def lead; Lead.find( lead_id ); end
|
data/lib/ish_models.rb
CHANGED
data/lib/office/email_action.rb
CHANGED
@@ -7,23 +7,28 @@ class Office::EmailAction
|
|
7
7
|
include Mongoid::Document
|
8
8
|
include Mongoid::Timestamps
|
9
9
|
|
10
|
+
# field :next_at_exe, type: :string
|
11
|
+
# field :next_in_days, type: :string
|
12
|
+
# field :next_at_time, type: :string
|
13
|
+
|
10
14
|
field :slug, type: :string
|
11
15
|
validates :slug, uniqueness: true, allow_nil: true
|
12
16
|
|
13
|
-
field :descr, type: :string
|
17
|
+
field :descr, type: :string ## optional, can remove
|
14
18
|
|
15
19
|
belongs_to :email_template, class_name: '::Ish::EmailTemplate'
|
16
20
|
def tmpl; email_template; end
|
17
21
|
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
belongs_to :prev_email_action, class_name: '::Office::EmailAction', optional: true, inverse_of: :next_email_actions
|
23
|
-
has_many :next_email_actions, class_name: '::Office::EmailAction', inverse_of: :prev_email_action
|
22
|
+
# belongs_to :prev_email_action, class_name: '::Office::EmailAction', optional: true, inverse_of: :next_email_actions
|
23
|
+
# has_many :next_email_actions, class_name: '::Office::EmailAction', inverse_of: :prev_email_action
|
24
|
+
# accepts_nested_attributes_for :next_email_actions
|
24
25
|
|
25
26
|
has_many :scheduled_email_actions, class_name: '::Office::ScheduledEmailAction'
|
26
27
|
def schs; scheduled_email_actions; end
|
27
28
|
|
28
|
-
|
29
|
+
has_many :ties, class_name: '::Office::EmailActionTie', inverse_of: :email_action
|
30
|
+
has_many :prev_ties, class_name: '::Office::EmailActionTie', inverse_of: :next_email_action
|
31
|
+
accepts_nested_attributes_for :ties
|
29
32
|
|
33
|
+
end
|
34
|
+
Act = Office::EmailAction
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
##
|
3
|
+
## act = Act.new ; tie = Actie.new; act.ties.push( tie )
|
4
|
+
##
|
5
|
+
class Office::EmailActionTie
|
6
|
+
include Mongoid::Document
|
7
|
+
include Mongoid::Timestamps
|
8
|
+
|
9
|
+
attr_accessor :to_delete
|
10
|
+
|
11
|
+
belongs_to :email_action, class_name: '::Office::EmailAction', inverse_of: :ties
|
12
|
+
belongs_to :next_email_action, class_name: '::Office::EmailAction', inverse_of: :prev_ties
|
13
|
+
|
14
|
+
|
15
|
+
field :next_at_exe, type: :string
|
16
|
+
validates :next_at_exe, presence: true
|
17
|
+
|
18
|
+
# field :next_in_days, type: :string
|
19
|
+
# field :next_at_time, type: :string
|
20
|
+
|
21
|
+
# field :slug, type: :string
|
22
|
+
# validates :slug, uniqueness: true, allow_nil: true
|
23
|
+
|
24
|
+
# field :descr, type: :string ## optional, can remove
|
25
|
+
|
26
|
+
# belongs_to :email_template, class_name: '::Ish::EmailTemplate'
|
27
|
+
# def tmpl; email_template; end
|
28
|
+
|
29
|
+
# belongs_to :prev_email_action, class_name: '::Office::EmailAction', optional: true, inverse_of: :next_email_actions
|
30
|
+
# has_many :next_email_actions, class_name: '::Office::EmailAction', inverse_of: :prev_email_action
|
31
|
+
# accepts_nested_attributes_for :next_email_actions
|
32
|
+
|
33
|
+
# has_many :scheduled_email_actions, class_name: '::Office::ScheduledEmailAction'
|
34
|
+
# def schs; scheduled_email_actions; end
|
35
|
+
|
36
|
+
end
|
37
|
+
Actie = Office::EmailActionTie
|
@@ -12,9 +12,9 @@ class Office::ScheduledEmailAction
|
|
12
12
|
Lead.find( lead_id )
|
13
13
|
end
|
14
14
|
|
15
|
-
STATE_ACTIVE
|
15
|
+
STATE_ACTIVE = 'active'
|
16
16
|
STATE_INACTIVE = 'inactive'
|
17
|
-
STATES
|
17
|
+
STATES = [ STATE_ACTIVE, STATE_INACTIVE ]
|
18
18
|
field :state, type: :string
|
19
19
|
scope :active, ->{ where( state: STATE_ACTIVE ) }
|
20
20
|
|
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.213
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/mongoid/voter.rb
|
145
145
|
- lib/newsitem.rb
|
146
146
|
- lib/office/email_action.rb
|
147
|
+
- lib/office/email_action_tie.rb
|
147
148
|
- lib/office/email_conversation.rb
|
148
149
|
- lib/office/email_filter.rb
|
149
150
|
- lib/office/email_message.rb
|