caboose-cms 0.5.106 → 0.5.107
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/caboose/gift_card.rb +8 -0
- data/app/models/caboose/line_item.rb +6 -1
- data/app/models/caboose/order_package.rb +6 -0
- data/app/models/caboose/order_transaction.rb +6 -0
- data/app/models/caboose/variant.rb +7 -0
- data/lib/caboose/version.rb +1 -1
- metadata +1 -2
- data/app/models/caboose/#Untitled-1# +0 -32
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODk1ZmViNmZkOGQzMDQ2ODFlMGY4MzQ0NTQ1ZTM2NmMzZWI2ZDA2ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjViYmUwMTUxMjExY2ZjMTM2MTUyZDM5YjIwMTc3NGJjZWZjMzBhOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjRlYjQ2OTVmOTkwM2MxMzgzMzU5YmVhNGJhYTM3ZDMxYWUxMzc3MmJlNjk0
|
10
|
+
MTlmMzUxM2QzNTgxMTA3ZDI5MWEzMzA4MTQyMjU0MzM4ZmQyMGQ3YTcwMDFh
|
11
|
+
MWQ5ZTBjNWU2MDMyNmE5N2IyODFjNmNhMGZiZGQ2NDQ0MjQzMTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODQ3MTc4YWZjMDU1MmViYTc0YmIwNTBkYzM5MTQ5ODcyOWU2OGJlODI4ZGVk
|
14
|
+
M2NkNmJhNzZiYjE5Nzc3MmJhOGNlNDBiODY0MDllOWFiZWM2MWE4N2ZiMDdm
|
15
|
+
YWIwMmUzZGE5MmI2YmM3MDcxZjFmZDA5MDMwODBkYmViZmRiZWI=
|
@@ -26,6 +26,14 @@ module Caboose
|
|
26
26
|
CARD_TYPE_PERCENTAGE = 'Percentage'
|
27
27
|
CARD_TYPE_NO_SHIPPING = 'No Shipping'
|
28
28
|
CARD_TYPE_NO_TAX = 'No Tax'
|
29
|
+
|
30
|
+
after_initialize :check_nil_fields
|
31
|
+
|
32
|
+
def check_nil_fields
|
33
|
+
self.total = 0.00 if self.total.nil?
|
34
|
+
self.balance = 0.00 if self.balance.nil?
|
35
|
+
self.min_order_total = 0.00 if self.min_order_total.nil?
|
36
|
+
end
|
29
37
|
|
30
38
|
def valid_for_order?(order)
|
31
39
|
return false if self.status != GiftCard::STATUS_ACTIVE
|
@@ -48,7 +48,12 @@ module Caboose
|
|
48
48
|
#
|
49
49
|
|
50
50
|
before_save :update_price
|
51
|
-
after_save { self.order.calculate }
|
51
|
+
after_save { self.order.calculate }
|
52
|
+
after_initialize :check_nil_fields
|
53
|
+
|
54
|
+
def check_nil_fields
|
55
|
+
self.price = 0.00 if self.price.nil?
|
56
|
+
end
|
52
57
|
|
53
58
|
#
|
54
59
|
# Methods
|
@@ -17,6 +17,12 @@ module Caboose
|
|
17
17
|
STATUS_PENDING = 'Pending'
|
18
18
|
STATUS_SHIPPED = 'Shipped'
|
19
19
|
|
20
|
+
after_initialize :check_nil_fields
|
21
|
+
|
22
|
+
def check_nil_fields
|
23
|
+
self.total = 0.00 if self.total.nil?
|
24
|
+
end
|
25
|
+
|
20
26
|
def self.custom_order_packages(store_config, order)
|
21
27
|
eval(store_config.order_packages_function)
|
22
28
|
end
|
@@ -39,6 +39,13 @@ module Caboose
|
|
39
39
|
:cylinder,
|
40
40
|
:shipping_unit_value
|
41
41
|
|
42
|
+
after_initialize :check_nil_fields
|
43
|
+
|
44
|
+
def check_nil_fields
|
45
|
+
self.price = 0.00 if self.price.nil?
|
46
|
+
self.sale_price = 0.00 if self.sale_price.nil?
|
47
|
+
end
|
48
|
+
|
42
49
|
#
|
43
50
|
# Class Methods
|
44
51
|
#
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.107
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -544,7 +544,6 @@ files:
|
|
544
544
|
- app/helpers/caboose/products_helper.rb
|
545
545
|
- app/mailers/caboose/login_mailer.rb
|
546
546
|
- app/mailers/caboose/orders_mailer.rb
|
547
|
-
- app/models/caboose/#Untitled-1#
|
548
547
|
- app/models/caboose/ab_option.rb
|
549
548
|
- app/models/caboose/ab_testing.rb
|
550
549
|
- app/models/caboose/ab_value.rb
|
@@ -1,32 +0,0 @@
|
|
1
|
-
|
2
|
-
Caboose::Discount => [
|
3
|
-
[ :amount , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }]
|
4
|
-
],
|
5
|
-
Caboose::GiftCard => [
|
6
|
-
[ :total , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
7
|
-
[ :balance , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
8
|
-
[ :min_order_total , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
9
|
-
],
|
10
|
-
Caboose::LineItem => [
|
11
|
-
[ :price , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
12
|
-
],
|
13
|
-
Caboose::OrderTransaction => [
|
14
|
-
[ :amount , :decimal , { :precision => 8, :scale => 2, :default => 0 }],
|
15
|
-
],
|
16
|
-
Caboose::OrderPackage => [
|
17
|
-
[ :total , :decimal , { :default => 0.0 }]
|
18
|
-
],
|
19
|
-
Caboose::Order => [
|
20
|
-
[ :subtotal , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
21
|
-
[ :tax , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
22
|
-
[ :shipping , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
23
|
-
[ :handling , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
24
|
-
[ :custom_discount , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
25
|
-
[ :discount , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
26
|
-
[ :total , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
27
|
-
[ :auth_amount , :decimal , { :precision => 8, :scale => 2 }]
|
28
|
-
],
|
29
|
-
Caboose::Variant => [
|
30
|
-
[ :price , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
31
|
-
[ :sale_price , :decimal , { :precision => 8, :scale => 2, :default => 0.00 }],
|
32
|
-
],
|