wco_models 3.1.0.73 → 3.1.0.75
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac0ff430c81efd11aced2ffa36e17bd8aebdad6e337ea3ef981adbe6154e35b
|
4
|
+
data.tar.gz: bc47f58cbac8d53afd585068c2f2de34768176a268126b1f05779c8cda55ec68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2b311cab305457585ca0a98e9f8381537747a3c2d6b5b407be0c8c0d88615b13292e6849118d81bc16cb30116b20a8a3b65b12f5fd9edb3a91512489333d84e
|
7
|
+
data.tar.gz: f4484697303ebf15d0f39b35f835911c01ea812336d14ba833d0df4ca7de4fb3ac9b53313cdd328e81c234c64b162c8209d928f6d0952cef7a17b5cec9f5e914
|
@@ -35,7 +35,7 @@ class WcoEmail::EmailFilter
|
|
35
35
|
|
36
36
|
STATUS_ACTIVE = 'active'
|
37
37
|
STATUS_INACTIVE = 'inactive'
|
38
|
-
|
38
|
+
STATUSES = [ STATUS_ACTIVE, STATUS_INACTIVE ]
|
39
39
|
field :status, type: :string, default: STATUS_ACTIVE
|
40
40
|
scope :active, ->{ where( status: STATUS_ACTIVE ) }
|
41
41
|
|
@@ -180,19 +180,19 @@ class WcoEmail::MessageStub
|
|
180
180
|
email_filters = WcoEmail::EmailFilter.active
|
181
181
|
email_filters.each do |filter|
|
182
182
|
reson = nil
|
183
|
-
if filter.from_regex && @message.from.downcase.match( filter.from_regex )
|
183
|
+
if filter.from_regex.present? && @message.from.downcase.match( filter.from_regex )
|
184
184
|
reason = 'from_regex'
|
185
185
|
end
|
186
|
-
if filter.from_exact && @message.from.downcase.include?( filter.from_exact.downcase )
|
186
|
+
if filter.from_exact.present? && @message.from.downcase.include?( filter.from_exact.downcase )
|
187
187
|
reason = 'from_exact'
|
188
188
|
end
|
189
|
-
if filter.body_exact && @message.part_html&.include?( filter.body_exact )
|
189
|
+
if filter.body_exact.present? && @message.part_html&.include?( filter.body_exact )
|
190
190
|
reason = 'body_exact'
|
191
191
|
end
|
192
|
-
if filter.subject_regex && @message.subject.match( filter.subject_regex )
|
192
|
+
if filter.subject_regex.present? && @message.subject.match( filter.subject_regex )
|
193
193
|
reason = 'subject_regex'
|
194
194
|
end
|
195
|
-
if filter.subject_exact && @message.subject.downcase.include?( filter.subject_exact.downcase )
|
195
|
+
if filter.subject_exact.present? && @message.subject.downcase.include?( filter.subject_exact.downcase )
|
196
196
|
reason = 'subject_exact'
|
197
197
|
end
|
198
198
|
|