wco_models 3.1.0.77 → 3.1.0.79

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: 75d573c20e2daa8d9ce98511e31788bef7f389ce4c67ff693e10cbd51062a704
4
- data.tar.gz: aace2791f359a233c5ea2c48fb88e84e17fd6c0d0a92dd6a8e2d581f243de576
3
+ metadata.gz: 47c1bfd514e6256509d803414d83c9788a784d763ef4f2d0498f2838b593c097
4
+ data.tar.gz: 525c22eab612f690439d427d0f714f937b6f77853ecad2fd6006b8f3fd4787e8
5
5
  SHA512:
6
- metadata.gz: 55b718c4db30af9bae6c6448337e1195766ab2efbf6d35df0c1a6be1380de61be33f414cbd17610dbee94882d7c7b9329d4510ffd4c4a64ee73633d7c67d38fd
7
- data.tar.gz: 8aabf72c5aef2900b195c704ee3875bb31c95ec1cf814f091d09692c9480265cd507ca510e5e48b2e67009b700b83231dc31a6c1ca8778432295155424d8f2a9
6
+ metadata.gz: e4d06549e214c3e666b692fb01abeff916827efa2bc77e38468e624eec463b24a67290d8327c6b7667220a44c6c4c0595ede9d7abcf78f5b845fcc3b08b84d17
7
+ data.tar.gz: b7cdd068d8a5f9607fee162d093ae0e8671e34ee94641daab7274ed23f3dbcbe849852e9664b9668e729c545b46624e32ca19c7571b38fb2d8bf6f2971a60cc8
@@ -64,3 +64,5 @@ class WcoEmail::EmailAction
64
64
  end
65
65
  end
66
66
 
67
+ Sch = WcoEmail::EmailAction
68
+
@@ -33,12 +33,6 @@ class WcoEmail::EmailFilter
33
33
  KINDS = [ nil, KIND_AUTORESPOND_TMPL, KIND_AUTORESPOND_EACT, KIND_ADD_TAG, KIND_REMOVE_TAG, KIND_DESTROY_SCHS]
34
34
  field :kind
35
35
 
36
- STATUS_ACTIVE = 'active'
37
- STATUS_INACTIVE = 'inactive'
38
- STATUSES = [ STATUS_ACTIVE, STATUS_INACTIVE ]
39
- field :status, type: :string, default: STATUS_ACTIVE
40
- scope :active, ->{ where( status: STATUS_ACTIVE ) }
41
-
42
36
  belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate', optional: true
43
37
  belongs_to :email_action_template, class_name: 'WcoEmail::EmailActionTemplate', optional: true
44
38
 
@@ -136,3 +136,4 @@ class WcoEmail::EmailTemplate
136
136
  end
137
137
 
138
138
  end
139
+ ET = WcoEmail::EmailTemplate
@@ -98,18 +98,19 @@ class WcoEmail::Message
98
98
  conv.tags -= [ filter.tag ]
99
99
 
100
100
  when WcoEmail::EmailFilter::KIND_AUTORESPOND_TMPL
101
- WcoEmail::Context.create({
101
+ WcoEmail::Context.create!({
102
102
  email_template: filter.email_template,
103
103
  lead_id: lead.id,
104
104
  send_at: Time.now,
105
105
  })
106
106
 
107
107
  when WcoEmail::EmailFilter::KIND_AUTORESPOND_EACT
108
- ::Sch.create({
109
- email_action: filter.email_action,
110
- state: ::Sch::STATE_ACTIVE,
111
- lead_id: lead.id,
112
- perform_at: Time.now,
108
+ # byebug
109
+ out = Sch.create!({
110
+ email_action_template: filter.email_action_template,
111
+ status: Sch::STATUS_ACTIVE,
112
+ lead_id: lead.id,
113
+ perform_at: Time.now,
113
114
  })
114
115
 
115
116
  else
@@ -178,9 +178,9 @@ class WcoEmail::MessageStub
178
178
 
179
179
 
180
180
  ## Actions & Filters
181
- email_filters = WcoEmail::EmailFilter.active
181
+ email_filters = WcoEmail::EmailFilter.all
182
182
  email_filters.each do |filter|
183
- reson = nil
183
+ reason = nil
184
184
  if filter.from_regex.present? && @message.from.downcase.match( filter.from_regex )
185
185
  reason = 'from_regex'
186
186
  end
@@ -198,7 +198,7 @@ class WcoEmail::MessageStub
198
198
  end
199
199
 
200
200
  if reason
201
- puts! "Applying filter #{filter} to conv #{conv} for matching #{reason}" if DEBUG
201
+ puts! "Applying filter #{filter} to conv #{@message.conversation} for matching #{reason}" if DEBUG
202
202
  @message.apply_filter( filter )
203
203
  end
204
204
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.77
4
+ version: 3.1.0.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev