effective_orders 6.7.3 → 6.8.1

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: 8aa1ddb69cee5eeb8fb020d877fb24ee95d8cce527fa01222eeaeca7ccb31d8e
4
- data.tar.gz: 3ec6df985d1a939b7780551a41badcd06ee4eacb88e2ad97c3bcd9d9da20700e
3
+ metadata.gz: b17d6da43052c30b3dc2e8b4ed1cb60722737444cdbc9246ebe8c1649500d9b7
4
+ data.tar.gz: 15463f7b06e80a2c4af84951338cedbc11f1f235e83daae1ca440f89d6ed6f7e
5
5
  SHA512:
6
- metadata.gz: 74f7ea6712882bfaf3c7f8ef643f2e951a5dd355197a7f167e6fae092625fe20a76691cb16b730d926876c958f6e8e26024af8a1580b4ea260a6227f1d301ef8
7
- data.tar.gz: b80bdb5f15eb7ff86739e9a0994ff54727fac1075bdc48f432ae13d6b65c6b1eaab77d532409a80fdd7f3c8f107be5e3a6214e0bd52ae75f534d38f84e0ba6ba
6
+ metadata.gz: 74c5371ed6996eb16b848fb534da9f65671467e8c163ab6bf4802c9c8485c44782991401ba089f69db8494b3b315e6aab42f919920af1c2f1a4b5b9d2104b062
7
+ data.tar.gz: be68655d47cc0efb3ea00fce27fe750e4a5d862e0be4ebfc2e734c607cd476a3184533369410328361602e7ca4f65396ce31b890debdc290f2ea1e825e124296
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class Cart < ActiveRecord::Base
3
- self.table_name = EffectiveOrders.carts_table_name.to_s
3
+ self.table_name = (EffectiveOrders.carts_table_name || :carts).to_s
4
4
 
5
5
  belongs_to :user, polymorphic: true, optional: true # Optional. We want non-logged-in users to have carts too.
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class CartItem < ActiveRecord::Base
3
- self.table_name = EffectiveOrders.cart_items_table_name.to_s
3
+ self.table_name = (EffectiveOrders.cart_items_table_name || :cart_items).to_s
4
4
 
5
5
  belongs_to :cart, counter_cache: true
6
6
  belongs_to :purchasable, polymorphic: true
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class Customer < ActiveRecord::Base
3
- self.table_name = EffectiveOrders.customers_table_name.to_s
3
+ self.table_name = (EffectiveOrders.customers_table_name || :customers).to_s
4
4
 
5
5
  attr_accessor :stripe_customer
6
6
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  module Effective
11
11
  class Order < ActiveRecord::Base
12
- self.table_name = EffectiveOrders.orders_table_name.to_s
12
+ self.table_name = (EffectiveOrders.orders_table_name || :orders).to_s
13
13
 
14
14
  # Effective Resources
15
15
  acts_as_statused(
@@ -3,7 +3,7 @@
3
3
  module Effective
4
4
  # An Order Item
5
5
  class OrderItem < ActiveRecord::Base
6
- self.table_name = EffectiveOrders.order_items_table_name.to_s
6
+ self.table_name = (EffectiveOrders.order_items_table_name || :order_items).to_s
7
7
 
8
8
  belongs_to :order
9
9
 
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class Product < ActiveRecord::Base
3
- self.table_name = EffectiveOrders.products_table_name.to_s
3
+ self.table_name = (EffectiveOrders.products_table_name || :products).to_s
4
4
 
5
5
  acts_as_purchasable
6
6
  log_changes if respond_to?(:log_changes)
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class Subscription < ActiveRecord::Base
3
- self.table_name = EffectiveOrders.subscriptions_table_name.to_s
3
+ self.table_name = (EffectiveOrders.subscriptions_table_name || :subscriptions).to_s
4
4
 
5
5
  attr_accessor :stripe_subscription
6
6
 
@@ -1,15 +1,6 @@
1
1
  # EffectiveOrders Rails Engine
2
2
 
3
3
  EffectiveOrders.setup do |config|
4
- # Configure Database Tables
5
- config.orders_table_name = :orders
6
- config.order_items_table_name = :order_items
7
- config.carts_table_name = :carts
8
- config.cart_items_table_name = :cart_items
9
- config.customers_table_name = :customers
10
- config.subscriptions_table_name = :subscriptions
11
- config.products_table_name = :products
12
-
13
4
  # Layout Settings
14
5
  # config.layout = { application: 'application', admin: 'admin' }
15
6
 
@@ -1,6 +1,6 @@
1
- class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
2
- def self.up
3
- create_table <%= @orders_table_name %> do |t|
1
+ class CreateEffectiveOrders < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :orders do |t|
4
4
  t.integer :user_id
5
5
  t.string :user_type
6
6
 
@@ -43,10 +43,9 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
43
43
  t.timestamps
44
44
  end
45
45
 
46
- add_index <%= @orders_table_name %>, :user_id
46
+ add_index :orders, :user_id
47
47
 
48
-
49
- create_table <%= @order_items_table_name %> do |t|
48
+ create_table :order_items do |t|
50
49
  t.integer :order_id
51
50
  t.string :purchasable_type
52
51
  t.integer :purchasable_id
@@ -59,12 +58,11 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
59
58
  t.timestamps
60
59
  end
61
60
 
62
- add_index <%= @order_items_table_name %>, :order_id
63
- add_index <%= @order_items_table_name %>, :purchasable_id
64
- add_index <%= @order_items_table_name %>, [:purchasable_type, :purchasable_id]
65
-
61
+ add_index :order_items, :order_id
62
+ add_index :order_items, :purchasable_id
63
+ add_index :order_items, [:purchasable_type, :purchasable_id]
66
64
 
67
- create_table <%= @carts_table_name %> do |t|
65
+ create_table :carts do |t|
68
66
  t.integer :user_id
69
67
  t.string :user_type
70
68
 
@@ -72,9 +70,9 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
72
70
  t.timestamps
73
71
  end
74
72
 
75
- add_index <%= @carts_table_name %>, :user_id
73
+ add_index :carts, :user_id
76
74
 
77
- create_table <%= @cart_items_table_name %> do |t|
75
+ create_table :cart_items do |t|
78
76
  t.integer :cart_id
79
77
  t.string :purchasable_type
80
78
  t.integer :purchasable_id
@@ -85,11 +83,11 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
85
83
  t.timestamps
86
84
  end
87
85
 
88
- add_index <%= @cart_items_table_name %>, :cart_id
89
- add_index <%= @cart_items_table_name %>, :purchasable_id
90
- add_index <%= @cart_items_table_name %>, [:purchasable_type, :purchasable_id]
86
+ add_index :cart_items, :cart_id
87
+ add_index :cart_items, :purchasable_id
88
+ add_index :cart_items, [:purchasable_type, :purchasable_id]
91
89
 
92
- create_table <%= @customers_table_name %> do |t|
90
+ create_table :customers do |t|
93
91
  t.integer :user_id
94
92
  t.string :user_type
95
93
 
@@ -103,9 +101,9 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
103
101
  t.timestamps
104
102
  end
105
103
 
106
- add_index <%= @customers_table_name %>, :user_id
104
+ add_index :customers, :user_id
107
105
 
108
- create_table <%= @subscriptions_table_name %> do |t|
106
+ create_table :subscriptions do |t|
109
107
  t.integer :customer_id
110
108
 
111
109
  t.integer :subscribable_id
@@ -123,11 +121,11 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
123
121
  t.timestamps
124
122
  end
125
123
 
126
- add_index <%= @subscriptions_table_name %>, :customer_id
127
- add_index <%= @subscriptions_table_name %>, :subscribable_id
128
- add_index <%= @subscriptions_table_name %>, [:subscribable_type, :subscribable_id]
124
+ add_index :subscriptions, :customer_id
125
+ add_index :subscriptions, :subscribable_id
126
+ add_index :subscriptions, [:subscribable_type, :subscribable_id]
129
127
 
130
- create_table <%= @products_table_name %> do |t|
128
+ create_table :products do |t|
131
129
  t.integer :purchased_order_id
132
130
 
133
131
  t.string :name
@@ -140,14 +138,4 @@ class CreateEffectiveOrders < ActiveRecord::Migration[4.2]
140
138
  end
141
139
 
142
140
  end
143
-
144
- def self.down
145
- drop_table <%= @orders_table_name %>
146
- drop_table <%= @order_items_table_name %>
147
- drop_table <%= @carts_table_name %>
148
- drop_table <%= @cart_items_table_name %>
149
- drop_table <%= @customers_table_name %>
150
- drop_table <%= @subscriptions_table_name %>
151
- drop_table <%= @products_table_name %>
152
- end
153
141
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.7.3'.freeze
2
+ VERSION = '6.8.1'.freeze
3
3
  end
@@ -47,15 +47,7 @@ module EffectiveOrders
47
47
  end
48
48
 
49
49
  def create_migration_file
50
- @orders_table_name = ':' + EffectiveOrders.orders_table_name.to_s
51
- @order_items_table_name = ':' + EffectiveOrders.order_items_table_name.to_s
52
- @carts_table_name = ':' + EffectiveOrders.carts_table_name.to_s
53
- @cart_items_table_name = ':' + EffectiveOrders.cart_items_table_name.to_s
54
- @customers_table_name = ':' + EffectiveOrders.customers_table_name.to_s
55
- @subscriptions_table_name = ':' + EffectiveOrders.subscriptions_table_name.to_s
56
- @products_table_name = ':' + EffectiveOrders.products_table_name.to_s
57
-
58
- migration_template ('../' * 3) + 'db/migrate/01_create_effective_orders.rb.erb', 'db/migrate/create_effective_orders.rb'
50
+ migration_template ('../' * 3) + 'db/migrate/101_create_effective_orders.rb', 'db/migrate/create_effective_orders.rb'
59
51
  end
60
52
 
61
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.3
4
+ version: 6.8.1
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-16 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
@@ -328,7 +328,7 @@ files:
328
328
  - config/effective_orders.rb
329
329
  - config/locales/effective_orders.en.yml
330
330
  - config/routes.rb
331
- - db/migrate/01_create_effective_orders.rb.erb
331
+ - db/migrate/101_create_effective_orders.rb
332
332
  - lib/effective_orders.rb
333
333
  - lib/effective_orders/engine.rb
334
334
  - lib/effective_orders/version.rb