effective_classifieds 0.2.0 → 0.2.3

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: b922833fe51ff1291c85c0708b708120ab0d87c25ff96185c62b105b53fb1fe7
4
- data.tar.gz: 7bbb631c54607a94616f8493234dbab069c1446b6d6256ed8758cba5b9c2dd2e
3
+ metadata.gz: '02458792301648b01098c825a54d2fa92267599f520340ac347f6ab7417cbcfb'
4
+ data.tar.gz: 92dbdd7f35880a95007e71827d3245ba97855ce4b1ee96cb5cb444a7710d8d5c
5
5
  SHA512:
6
- metadata.gz: c0945747f72335c70181f4f63f89467b936974ad166a938a70e6b97ce23201b42c034997c4279d7f7372662b6afe15e1101759e3551e6d9a495612a9aa3fa148
7
- data.tar.gz: c7dea63e19d5d077ba9c83f0cfaf7bace041f2aa82fdfa173fb5b8d75a5d8358a7380cc759769f75ce308d8b2c698ff88255791ea060e5fb705664d1ee3e209a
6
+ metadata.gz: 53f7ffcdfbf0b0213249c8d5ac4dc8ce3a519702776706e5e4bfeb09cb50e73d0ecba3c55057db19ce392fe44a51864adb02079ab8d4e295ba03e2d0e69fa08f
7
+ data.tar.gz: f70627b5a9963d3e5cd0832448441c2e6288c8c0fc591f414b77bc5c0790cd425d1cfc38d2436d184ac909800289f7a17829e5f24cbf550bc2ba95a61f58b673
@@ -6,26 +6,5 @@ module Effective
6
6
 
7
7
  resource_scope -> { EffectiveClassifieds.ClassifiedWizard.deep.where(owner: current_user) }
8
8
 
9
- # Allow only 1 in-progress application at a time
10
- before_action(only: [:new, :show], unless: -> { resource&.done? }) do
11
- existing = resource_scope.in_progress.where.not(id: resource).first
12
-
13
- if existing.present?
14
- flash[:success] = "You have been redirected to your in-progress classified ad submission"
15
- redirect_to effective_classifieds.classified_wizard_build_path(existing, existing.next_step)
16
- end
17
- end
18
-
19
- after_save do
20
- flash.now[:success] = ''
21
- end
22
-
23
- private
24
-
25
- def permitted_params
26
- model = (params.key?(:effective_classified_wizard) ? :effective_classified_wizard : :classified_wizard)
27
- params.require(model).permit!.except(:status, :status_steps, :wizard_steps, :submitted_at)
28
- end
29
-
30
9
  end
31
10
  end
@@ -26,7 +26,7 @@ module Effective
26
26
  private
27
27
 
28
28
  def permitted_params
29
- params.require(:effective_classified).permit!.except(:status, :status_steps)
29
+ params.require(:effective_classified).except(:status, :status_steps).permit!
30
30
  end
31
31
 
32
32
  end
@@ -16,7 +16,7 @@ class Admin::EffectiveClassifiedWizardsDatatable < Effective::Datatable
16
16
  end
17
17
 
18
18
  collection do
19
- EffectiveSubmissions.ClassifiedWizard.all.deep.done.joins(:classified)
19
+ EffectiveClassifieds.ClassifiedWizard.all.deep.done.joins(:classified)
20
20
  end
21
21
 
22
22
  end
@@ -2,7 +2,7 @@ module Effective
2
2
  class ClassifiedsMailer < EffectiveClassifieds.parent_mailer_class
3
3
 
4
4
  default from: -> { EffectiveClassifieds.mailer_sender }
5
- layout -> { EffectiveClassifieds.mailer_layout || 'effective_classifieds_mailer_layout' }
5
+ layout -> { EffectiveClassifieds.mailer_layout }
6
6
 
7
7
  def classified_submitted(resource, opts = {})
8
8
  raise('expected an Effective::Classification') unless resource.kind_of?(Effective::Classified)
@@ -24,22 +24,18 @@ EffectiveClassifieds.setup do |config|
24
24
  # Automatically approve classified ad submissions, otherwise require admin approval
25
25
  config.auto_approve = false
26
26
 
27
- # Mailer Configuration
27
+ # Mailer Settings
28
+ # Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
29
+ #
28
30
  # Configure the class responsible to send e-mails.
29
31
  # config.mailer = 'Effective::ClassifiedsMailer'
32
+ #
33
+ # Override effective_resource mailer defaults
34
+ #
35
+ # config.parent_mailer = nil # The parent class responsible for sending emails
36
+ # config.deliver_method = nil # The deliver method, deliver_later or deliver_now
37
+ # config.mailer_layout = nil # Default mailer layout
38
+ # config.mailer_sender = nil # Default From value
39
+ # config.mailer_admin = nil # Default To value for Admin correspondence
30
40
 
31
- # Configure the parent class responsible to send e-mails.
32
- # config.parent_mailer = 'ActionMailer::Base'
33
-
34
- # Default deliver method
35
- # config.deliver_method = :deliver_later
36
-
37
- # Default layout
38
- # config.mailer_layout = 'effective_classifieds_mailer_layout'
39
-
40
- # Default From
41
- config.mailer_sender = "no-reply@example.com"
42
-
43
- # Send Admin correspondence To
44
- config.mailer_admin = "admin@example.com"
45
41
  end
@@ -33,8 +33,8 @@ class CreateEffectiveClassifieds < ActiveRecord::Migration[6.1]
33
33
  t.timestamps
34
34
  end
35
35
 
36
- add_index :classifieds, [:owner_id, :owner_type]
37
- add_index :classifieds, :slug
36
+ add_index <%= @classifieds_table_name %>, [:owner_id, :owner_type]
37
+ add_index <%= @classifieds_table_name %>, :slug
38
38
 
39
39
  create_table <%= @classified_wizards_table_name %> do |t|
40
40
  t.string :token
@@ -56,7 +56,7 @@ class CreateEffectiveClassifieds < ActiveRecord::Migration[6.1]
56
56
  t.datetime :created_at
57
57
  end
58
58
 
59
- add_index :classified_wizards, [:owner_id, :owner_type]
60
- add_index :classified_wizards, :token
59
+ add_index <%= @classified_wizards_table_name %>, [:owner_id, :owner_type]
60
+ add_index <%= @classified_wizards_table_name %>, :token
61
61
  end
62
62
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_classifieds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -213,7 +213,6 @@ files:
213
213
  - app/views/effective/classifieds/index.html.haml
214
214
  - app/views/effective/classifieds/show.html.haml
215
215
  - app/views/effective/classifieds_mailer/classified_submitted.html.haml
216
- - app/views/layouts/effective_classifieds_mailer_layout.html.haml
217
216
  - config/effective_classifieds.rb
218
217
  - config/routes.rb
219
218
  - db/migrate/01_create_effective_classifieds.rb.erb
@@ -1,7 +0,0 @@
1
- !!!
2
- %html{style: 'background: #fff;'}
3
- %head
4
- %meta{:content => 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type'}
5
-
6
- %body{style: 'background: #fff;'}
7
- = yield