effective_orders 5.1.6 → 5.1.7
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 +17 -1
- 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: 642b6831172be548e28cec2adf8c2f13f75ec9ef9af0e1cb15ee48cb763e3edc
|
4
|
+
data.tar.gz: ce4111bbaf7d8fb7a50e16c7ff8a0a43ae412586d2c7063a9c6e910d1337fbc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7e2f6adabe417e43819f95c46e12dcc2c36680c82bedc870041a7665a700428428888927eb35b1dca18ab89d3d695b03183edc3cb35be3e1406f3befa0eee80
|
7
|
+
data.tar.gz: 5650b3ed6960e16d3c630be6697ab9fe69084122a543f2cbbfec875a6defa3fefeb0bb19655affcaadbb4b15e074d5191579aead15107a91f447b401ae31f2aa
|
@@ -203,9 +203,21 @@ module Effective
|
|
203
203
|
# Duplicate an existing order
|
204
204
|
self.note_to_buyer ||= item.note_to_buyer
|
205
205
|
self.note_internal ||= item.note_internal
|
206
|
+
self.cc ||= item.cc
|
206
207
|
|
207
208
|
item.order_items.select { |oi| oi.purchasable.kind_of?(Effective::Product) }.map do |oi|
|
208
|
-
|
209
|
+
purchasable = oi.purchasable
|
210
|
+
|
211
|
+
product = Effective::Product.new(name: purchasable.purchasable_name, price: purchasable.price, tax_exempt: purchasable.tax_exempt)
|
212
|
+
|
213
|
+
# Copy over any extended attributes that may have been created
|
214
|
+
atts = purchasable.dup.attributes.except('name', 'price', 'tax_exempt', 'purchased_order_id').compact
|
215
|
+
|
216
|
+
atts.each do |k, v|
|
217
|
+
next unless product.respond_to?("#{k}=") && product.respond_to?(k)
|
218
|
+
product.send("#{k}=", v) if product.send(k).blank?
|
219
|
+
end
|
220
|
+
|
209
221
|
Effective::CartItem.new(quantity: oi.quantity, purchasable: product)
|
210
222
|
end
|
211
223
|
else
|
@@ -283,6 +295,10 @@ module Effective
|
|
283
295
|
[card, '-', last4].compact.join(' ')
|
284
296
|
end
|
285
297
|
|
298
|
+
def duplicate
|
299
|
+
Effective::Order.new(self)
|
300
|
+
end
|
301
|
+
|
286
302
|
# For moneris and moneris_checkout. Just a unique value.
|
287
303
|
def transaction_id
|
288
304
|
[to_param, billing_name.to_s.parameterize.presence, Time.zone.now.to_i].compact.join('-')
|
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.1.
|
4
|
+
version: 5.1.7
|
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-09-
|
11
|
+
date: 2021-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|