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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72eca7d0655eb6a817f703d2787d7a211d5b9da7889aaf1920ec79edb49384b7
4
- data.tar.gz: ff602f25ce5ab9294c292e98060d505da015b6fb38c57f11463705d404871183
3
+ metadata.gz: 982893ebe426c1097f68ffaccbd87a1977c5d48f4ce1a45dbbf5b13752572542
4
+ data.tar.gz: 1742602893eb3c98aea29e31161c05e60b67929802ed51a39c40d20fb3c4f2b3
5
5
  SHA512:
6
- metadata.gz: 251acbaf892b9f51e0fd6ebd739d1a64538b6a597f071afcd4d2c0fd3b4b839c9f4423594620ae31ed7ce4dc8c92a79bbe30e7d6f2d07a3ab29607eab04accbe
7
- data.tar.gz: bd8a5fd153eba267e138a32f598e01888c427fde5171327cc6271b8a1d7dcea7931f2d4b3187981f7bcea1e3e397cef4aafedd00aa64504c66b221f0deadd04b
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.0.1'.freeze
2
+ VERSION = '5.0.2'.freeze
3
3
  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.1
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-01 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails