effective_orders 6.5.2 → 6.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71798da0cd20778fab3e106211f2e7b0ef691f38ba568e9161739b6016a54c18
|
4
|
+
data.tar.gz: 5261409794ba913635a2966cc6afc7086f4e31e3cc80aea214716270d65536fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed613f93dba098d010277e6bf8cd0eeeba6ef9e3f66d417e5010558c31f1132250e1ee83afe9b9f9a1b8356d60e0118a8178ddba4208e0b4927b9eabec8a955
|
7
|
+
data.tar.gz: c19f20987bfb6e0431eba2a0b5e45b70f824202c9a894223891a7f93d5bf16504271918a501153249bd54183aa3f0c04ff1e4b9126666aafcad9dafa7ed9118d
|
@@ -583,6 +583,12 @@ module Effective
|
|
583
583
|
false
|
584
584
|
end
|
585
585
|
|
586
|
+
# Called by effective_memberships to update prices from purchasable fees
|
587
|
+
# Not called internally
|
588
|
+
def update_purchasable_attributes
|
589
|
+
present_order_items.each { |oi| oi.update_purchasable_attributes }
|
590
|
+
end
|
591
|
+
|
586
592
|
# Call this as a way to skip over non consequential orders
|
587
593
|
# And mark some purchasables purchased
|
588
594
|
# This is different than the Mark as Paid payment processor
|
@@ -37,7 +37,17 @@ module Effective
|
|
37
37
|
|
38
38
|
# This method is called in a before_validation in order.assign_order_values()
|
39
39
|
def assign_purchasable_attributes
|
40
|
-
|
40
|
+
return unless purchasable.present?
|
41
|
+
|
42
|
+
self.name ||= purchasable.purchasable_name
|
43
|
+
self.price ||= purchasable.price
|
44
|
+
self.tax_exempt = purchasable.tax_exempt if self.tax_exempt.nil?
|
45
|
+
end
|
46
|
+
|
47
|
+
def update_purchasable_attributes
|
48
|
+
if purchasable.present? && !marked_for_destruction?
|
49
|
+
assign_attributes(name: purchasable.purchasable_name, price: purchasable.price, tax_exempt: purchasable.tax_exempt)
|
50
|
+
end
|
41
51
|
end
|
42
52
|
|
43
53
|
def build_purchasable(atts = {})
|