effective_classifieds 0.2.4 → 0.2.5

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: 3800f94dc914a5451621ba31e2a791ceb1bfb0be11ccb27cfab08161368a84ab
4
- data.tar.gz: d16ab09d94918e0a5133127bfcd6f62366081baf46918894a69369b45ca52b1b
3
+ metadata.gz: 68e3527fba69fa6c8b8c487d99738c1d45f20b4b12fd8daa9ba425a977805015
4
+ data.tar.gz: a8f587d9a36bd2a37eae7629d0ba9586de7c94ad189e3f8f5d740b766941d950
5
5
  SHA512:
6
- metadata.gz: bba4c7426535e984578c7649d026d757f1c49a7599020935449dd5d2f68aeec745b1e795b246a48e63b03156ef55eeff351d055940ceee27180f1320bd518890
7
- data.tar.gz: 7f65ddfe36db6731bdc1d21e001a107ec7fd52d204a3c0c71f29bbea109e7d01719a57d0527b154ce7fdb2af5a1a1dda6a4b37fb9372b2576b84fec271c18cba
6
+ metadata.gz: 5ed6350f3d0e6dc2244cf30ccfa0ebcc0aa14f10fe5665ce9f4d993d718169ca3bd9ec6f7eba347803fd14cfecc6fb2ca9d0c4932f6bfa587cb7b370f9bc2e22
7
+ data.tar.gz: 26d6d75e322bfd4d5e30b635266012e229b2136cfa5a8feac4291fbfcf0280c8d0d352c74babdb5c247ed94c7c4101971ca480a4efb821c9018d87ace94a18bc
@@ -1,21 +1,16 @@
1
1
  module Effective
2
2
  class ClassifiedsMailer < EffectiveClassifieds.parent_mailer_class
3
3
 
4
- default from: -> { EffectiveClassifieds.mailer_sender }
5
- layout -> { EffectiveClassifieds.mailer_layout }
4
+ include EffectiveMailer
6
5
 
7
6
  def classified_submitted(resource, opts = {})
8
- raise('expected an Effective::Classification') unless resource.kind_of?(Effective::Classified)
7
+ raise('expected an Effective::Classified') unless resource.kind_of?(Effective::Classified)
9
8
 
10
9
  @classified = resource
10
+ subject = subject_for(:classified_submitted, 'Classified Submitted', resource, opts)
11
+ headers = headers_for(resource, opts)
11
12
 
12
- mail(to: EffectiveClassifieds.mailer_admin, **headers_for(resource, opts))
13
- end
14
-
15
- protected
16
-
17
- def headers_for(resource, opts = {})
18
- resource.respond_to?(:log_changes_datatable) ? opts.merge(log: resource) : opts
13
+ mail(to: mailer_admin, subject: subject, **headers)
19
14
  end
20
15
 
21
16
  end
@@ -140,8 +140,8 @@ module Effective
140
140
  def published?
141
141
  return false unless approved?
142
142
  return false if archived?
143
- return false if start_on.blank? || (Time.zone.now.to_date < start_on)
144
- return false if end_on.present? && (Time.zone.now.to_date >= end_on)
143
+ return false if start_on.blank? || (Time.zone.now < start_on)
144
+ return false if end_on.present? && (Time.zone.now >= end_on)
145
145
  true
146
146
  end
147
147
 
@@ -37,5 +37,5 @@ EffectiveClassifieds.setup do |config|
37
37
  # config.mailer_layout = nil # Default mailer layout
38
38
  # config.mailer_sender = nil # Default From value
39
39
  # config.mailer_admin = nil # Default To value for Admin correspondence
40
-
40
+ # config.mailer_subject = nil # Proc.new method used to customize Subject
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
@@ -8,9 +8,9 @@ module EffectiveClassifieds
8
8
  def self.config_keys
9
9
  [
10
10
  :classifieds_table_name, :classified_wizards_table_name,
11
+ :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
11
12
  :layout, :categories, :per_page, :use_effective_roles, :max_duration, :auto_approve,
12
- :classified_wizard_class_name,
13
- :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin
13
+ :classified_wizard_class_name
14
14
  ]
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_classifieds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect