wco_models 3.1.0.259 → 3.1.0.261

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 223ecc2a00f0a91ac463c96c09c386ded1ce3c6ef6f074283bce68c1be7def91
4
- data.tar.gz: 7d90b43527a97ebf2411f68c083a4e81729629178d3c7fb7187a8aafabafec46
3
+ metadata.gz: 3e90c90e58a413c94a73e6cc5da35fd724634790bb8e4f6a42e20a18d330cf95
4
+ data.tar.gz: 980def5c78027ec60232dece1d52000c26a89da3e24e0d8a4027134a1a5a4bd0
5
5
  SHA512:
6
- metadata.gz: f23a86024790353dfd074f772998705163a303a3dd2187d280b9469886c5664f63fa57dab848c4f3b60b7be97bf65f55a00c4c2dab46fec2e0b1a59c393467bb
7
- data.tar.gz: 5d1ec8a966e0890c5a1064b6b65c7c7efa2b5d5a2b421d164f622a8d45b8646d022b5ac6b2a60c8e2ec5a1bd7fcef4396f3661f0eba50fb2a494ad97e49886fb
6
+ metadata.gz: 5ea84529f57fff851bac682768282ce399046f4fa8d4b3efa7ed49b7358863627a6b6c436888bd404f0c5f5a0b92d6b4149b47b7e48d2c8354619bcf9137c79a
7
+ data.tar.gz: e99a245ca0ada50e9e6b3da6e3bea6d477fd6b0330cb435e34363c74a31fdf008640d5d5eb0e07a79d44cf0ee17e30d4079395b507e8dc4ecf77029449b43c38
@@ -12,7 +12,7 @@ class Wco::Leadset
12
12
  index({ company_url: 1 }, { unique: true, name: 'company_url' })
13
13
  before_validation :normalize_company_url, on: :create
14
14
  def normalize_company_url
15
- company_url.downcase
15
+ company_url.downcase rescue company_url
16
16
  end
17
17
  def domain; company_url; end # for anti-spam
18
18
  def self.from_email email
@@ -83,26 +83,26 @@ class WcoEmail::Message
83
83
  has_many :photos, class_name: '::Wco::Photo'
84
84
  has_many :replies, class_name: '::WcoEmail::Context', inverse_of: :reply_to_message
85
85
 
86
- def apply2_filter filter
87
- conv.filter = filter
88
- filter.actions each do |action|
89
- case action.kind
90
- when WcoEmail::EmailFilterAction::KIND_OAT
91
-
92
- config = {
93
- 'email_message_id' => self.id,
94
- 'lead_id' => lead_id,
95
- 'message_id' => self.id,
96
- 'stub_id' => stub_id,
97
- }
98
- oa = Wco::OfficeAction.create!({
99
- office_action_template: filter.aject,
100
- status: 'active',
101
- perform_at: Time.now,
102
- config: config,
103
- })
86
+ def apply_filter_action action
87
+ message = self
88
+
89
+ case action.kind
90
+ when WcoEmail::EmailFilterAction::KIND_OAT
91
+
92
+ config = {
93
+ 'email_message_id' => message.id.to_s,
94
+ 'lead_id' => message.lead_id.to_s,
95
+ # 'message_id' => message.id.to_s,
96
+ 'stub_id' => message.stub_id.to_s,
97
+ }
98
+ oa = Wco::OfficeAction.create!({
99
+ office_action_template: action.aject,
100
+ status: 'active',
101
+ perform_at: Time.now,
102
+ config: config,
103
+ })
104
+
104
105
 
105
- end
106
106
  end
107
107
  end
108
108
 
@@ -170,7 +170,10 @@ class WcoEmail::MessageStub
170
170
  if skip_reason
171
171
  puts! "NOT Applying filter #{filter} to conv #{@message.conversation} for matching #{skip_reason}" if DEBUG
172
172
  else
173
- @message.apply2_filter( filter )
173
+ @conv.filter = filter; @conv.save
174
+ filter.actions.each do |action|
175
+ @message.apply_filter_action( action )
176
+ end
174
177
  end
175
178
  end
176
179
  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.259
4
+ version: 3.1.0.261
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev