wco_models 3.1.0.72 → 3.1.0.74

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: 302a2a1a1d3081af93564469f98f0ae71e307be1dfe55f6434e1e8fe91530d6e
4
- data.tar.gz: 473811f82c6920371f5739b7bcc5e8914907ac589a08f6dee0babf77fc4c9973
3
+ metadata.gz: '001333244903db535c3a5a5dcdcb6ed004dade16013fbf4076fe0bf2a2906ac5'
4
+ data.tar.gz: b32bd3b75f89fac0022b3ac29ffc2ae808840d95c334de2457b44356764d2c7a
5
5
  SHA512:
6
- metadata.gz: c164f95273599dce14bd7549fbe38b5a3aa0ee4008b2e34ff29f6370af701be4ccf2a3c69485407646465cea79f8c4578b21f5ae3af4e763205110b8bb7cc92e
7
- data.tar.gz: 3afb7f8481bd2d87f9e76991347008b70affa6d500d22e4cb0cb82beb3ca5c50aebaeb8521a197306479ba62148a8d6defc1c0b20a8e78c6e1866972cbf68581
6
+ metadata.gz: 83f6a385a033a7a49e5bc45fd9f3fb5f8e9cbf3bf43167bd43e0444dc0829a656aa229d14bc0b7ac4ff6d67d9ac0f392cdf7d622b281237480786440fb428fce
7
+ data.tar.gz: e723c180e2445f15ce7e2dc963f01afa0d1033e7521c49d3c2e0f85c14e52ce38474c3fc76b5076c88823d9bdfb75fb1dcf79637fb03b59538c8fbcc0c57f8c7
@@ -73,9 +73,8 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
73
73
  renderer.instance_variable_set( :@tmpl_config, @tmpl_config )
74
74
 
75
75
  rendered_str = renderer.render_to_string("/wco_email/email_templates/_#{@ctx.tmpl.layout}")
76
- @ctx.update!({
76
+ @ctx.update({
77
77
  rendered_str: rendered_str,
78
- sent_at: Time.now.to_s,
79
78
  })
80
79
 
81
80
  mail( from: @ctx.from_email,
@@ -35,7 +35,7 @@ class WcoEmail::EmailFilter
35
35
 
36
36
  STATUS_ACTIVE = 'active'
37
37
  STATUS_INACTIVE = 'inactive'
38
- STATUSS = [ STATUS_ACTIVE, STATUS_INACTIVE ]
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
 
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.72
4
+ version: 3.1.0.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev