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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68e3527fba69fa6c8b8c487d99738c1d45f20b4b12fd8daa9ba425a977805015
|
4
|
+
data.tar.gz: a8f587d9a36bd2a37eae7629d0ba9586de7c94ad189e3f8f5d740b766941d950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
layout -> { EffectiveClassifieds.mailer_layout }
|
4
|
+
include EffectiveMailer
|
6
5
|
|
7
6
|
def classified_submitted(resource, opts = {})
|
8
|
-
raise('expected an Effective::
|
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:
|
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
|
144
|
-
return false if end_on.present? && (Time.zone.now
|
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
|
@@ -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
|
|