effective_orders 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/order.rb +0 -10
- data/app/models/effective/order_item.rb +10 -0
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 982893ebe426c1097f68ffaccbd87a1977c5d48f4ce1a45dbbf5b13752572542
|
4
|
+
data.tar.gz: 1742602893eb3c98aea29e31161c05e60b67929802ed51a39c40d20fb3c4f2b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa41b81eba8d7c6364fe8192f3e072149562228a666cd8b7b2b41845258e1684a00947bce0b890d9f77f5887ae1a87ba377b68909c7f99d2773ac1801acd12c4
|
7
|
+
data.tar.gz: f7759f4669a5a66492b6dd0259d5e744d64c403775112d0577280397d4b31e2d98dd66bf764e18c4e5359b16346d22b9444ecb65b087b55c4638e2bf28eccfa2
|
@@ -34,10 +34,6 @@ module Effective
|
|
34
34
|
belongs_to :user, polymorphic: true, validate: false # This is the buyer/user of the order. We validate it below.
|
35
35
|
has_many :order_items, -> { order(:id) }, inverse_of: :order, dependent: :delete_all
|
36
36
|
|
37
|
-
if defined?(EffectiveQbSync)
|
38
|
-
has_one :qb_order_item
|
39
|
-
end
|
40
|
-
|
41
37
|
accepts_nested_attributes_for :order_items, allow_destroy: false, reject_if: :all_blank
|
42
38
|
accepts_nested_attributes_for :user, allow_destroy: false, update_only: true
|
43
39
|
|
@@ -265,12 +261,6 @@ module Effective
|
|
265
261
|
end
|
266
262
|
end
|
267
263
|
|
268
|
-
# first or build
|
269
|
-
def qb_item_name
|
270
|
-
raise('expected EffectiveQbSync gem') unless defined?(EffectiveQbSync)
|
271
|
-
(qb_order_item || build_qb_order_item(name: purchasable.qb_item_name)).name
|
272
|
-
end
|
273
|
-
|
274
264
|
def pending?
|
275
265
|
state == EffectiveOrders::PENDING
|
276
266
|
end
|
@@ -5,6 +5,10 @@ module Effective
|
|
5
5
|
belongs_to :order
|
6
6
|
belongs_to :purchasable, polymorphic: true
|
7
7
|
|
8
|
+
if defined?(EffectiveQbSync)
|
9
|
+
has_one :qb_order_item
|
10
|
+
end
|
11
|
+
|
8
12
|
effective_resource do
|
9
13
|
name :string
|
10
14
|
quantity :integer
|
@@ -61,5 +65,11 @@ module Effective
|
|
61
65
|
end
|
62
66
|
end
|
63
67
|
|
68
|
+
# first or build
|
69
|
+
def qb_item_name
|
70
|
+
raise('expected EffectiveQbSync gem') unless defined?(EffectiveQbSync)
|
71
|
+
(qb_order_item || build_qb_order_item(name: purchasable.qb_item_name)).name
|
72
|
+
end
|
73
|
+
|
64
74
|
end
|
65
75
|
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: 5.0.
|
4
|
+
version: 5.0.2
|
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: 2021-03-
|
11
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|