effective_classifieds 0.5.0 → 0.6.0

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: 0e0ef9d80b727dd2010987510e92ba800401209d898f2797d82ab2bd16054aa2
4
- data.tar.gz: c19d09c1d221d9c48869b25cbb643bf4d5f59cc7ee7de3b04c3a4e51d6019ca9
3
+ metadata.gz: 79336bbb620e6d45dee7ef30b76c3e8d6af610355c5839e6995edc190eeead60
4
+ data.tar.gz: f679373fb3056d855711d9e6668e68e06cb434f1804ca7f0052e8d86aeb5f82d
5
5
  SHA512:
6
- metadata.gz: d151d6779e798212ad62143da7ece3d75da8ebcdfcf8ad48a1946f841847028bd88e4e57d5486426aecbcb8a81606bd7c75d1063a53db13cafd2d81e87d3b986
7
- data.tar.gz: 4b2fe777a078b329dc464dea6fa556887568d2a1db578499510fe6653e8176552c0198b5581949a2a052bb6ecfbff39364cd3e2e94a822d6f04d0fb801c513d5
6
+ metadata.gz: 0e4add172e382d41b1f78407971a33170afd46e138c71913210e51508beddc9b7588714cd411aa9e2e7827abf31245a377cdf8d40c725317756ba0efb3fc9138
7
+ data.tar.gz: 50009a6e425035cc59e58abbcf32ce6d70e73eb19a9c7be131e5c50de1ca6bd14ee37729c288709279d7492a71dc506e68ce132c430db205f36c65e15d22a228
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Effective
4
4
  class Classified < ActiveRecord::Base
5
- self.table_name = EffectiveClassifieds.classifieds_table_name.to_s
5
+ self.table_name = (EffectiveClassifieds.classifieds_table_name || :classifieds).to_s
6
6
 
7
7
  attr_accessor :current_user
8
8
  attr_accessor :importing
@@ -177,5 +177,9 @@ module Effective
177
177
  approved!
178
178
  end
179
179
 
180
+ def unapprove!
181
+ unapproved!
182
+ end
183
+
180
184
  end
181
185
  end
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class ClassifiedWizard < ActiveRecord::Base
3
- self.table_name = EffectiveClassifieds.classified_wizards_table_name.to_s
3
+ self.table_name = (EffectiveClassifieds.classified_wizards_table_name || :classified_wizards).to_s
4
4
 
5
5
  effective_classifieds_classified_wizard
6
6
  end
@@ -1,7 +1,4 @@
1
1
  EffectiveClassifieds.setup do |config|
2
- config.classifieds_table_name = :classifieds
3
- config.classified_wizards_table_name = :classified_wizards
4
-
5
2
  # Every classified must have a category.
6
3
  config.categories = ['Job', 'Equipment Sales', 'Other']
7
4
 
data/config/routes.rb CHANGED
@@ -19,6 +19,7 @@ EffectiveClassifieds::Engine.routes.draw do
19
19
  namespace :admin do
20
20
  resources :classifieds, except: [:show] do
21
21
  post :approve, on: :member
22
+ post :unapprove, on: :member
22
23
  end
23
24
 
24
25
  resources :jobs, except: [:show], controller: 'classifieds'
@@ -1,6 +1,6 @@
1
- class CreateEffectiveClassifieds < ActiveRecord::Migration[6.1]
1
+ class CreateEffectiveClassifieds < ActiveRecord::Migration[6.0]
2
2
  def change
3
- create_table <%= @classifieds_table_name %> do |t|
3
+ create_table :classifieds do |t|
4
4
  t.integer :classified_wizard_id
5
5
  t.string :classified_wizard_type
6
6
 
@@ -39,10 +39,10 @@ class CreateEffectiveClassifieds < ActiveRecord::Migration[6.1]
39
39
  t.timestamps
40
40
  end
41
41
 
42
- add_index <%= @classifieds_table_name %>, [:owner_id, :owner_type]
43
- add_index <%= @classifieds_table_name %>, :slug
42
+ add_index :classifieds, [:owner_id, :owner_type]
43
+ add_index :classifieds, :slug
44
44
 
45
- create_table <%= @classified_wizards_table_name %> do |t|
45
+ create_table :classified_wizards do |t|
46
46
  t.string :token
47
47
 
48
48
  t.integer :owner_id
@@ -65,7 +65,7 @@ class CreateEffectiveClassifieds < ActiveRecord::Migration[6.1]
65
65
  t.datetime :created_at
66
66
  end
67
67
 
68
- add_index <%= @classified_wizards_table_name %>, [:owner_id, :owner_type]
69
- add_index <%= @classified_wizards_table_name %>, :token
68
+ add_index :classified_wizards, [:owner_id, :owner_type]
69
+ add_index :classified_wizards, :token
70
70
  end
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
@@ -20,10 +20,7 @@ module EffectiveMemberships
20
20
  end
21
21
 
22
22
  def create_migration_file
23
- @classifieds_table_name = ':' + EffectiveClassifieds.classifieds_table_name.to_s
24
- @classified_wizards_table_name = ':' + EffectiveClassifieds.classified_wizards_table_name.to_s
25
-
26
- migration_template ('../' * 3) + 'db/migrate/01_create_effective_classifieds.rb.erb', 'db/migrate/create_effective_classifieds.rb'
23
+ migration_template ('../' * 3) + 'db/migrate/101_create_effective_classifieds.rb', 'db/migrate/create_effective_classifieds.rb'
27
24
  end
28
25
 
29
26
  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.5.0
4
+ version: 0.6.0
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: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -250,7 +250,7 @@ files:
250
250
  - config/effective_classifieds.rb
251
251
  - config/locales/effective_classifieds.en.yml
252
252
  - config/routes.rb
253
- - db/migrate/01_create_effective_classifieds.rb.erb
253
+ - db/migrate/101_create_effective_classifieds.rb
254
254
  - db/seeds.rb
255
255
  - lib/effective_classifieds.rb
256
256
  - lib/effective_classifieds/engine.rb