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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTlkMjdmZmNhMzA4OTE4MDUwMjBkNTRiMTVlYmM0YWM4MjM1ODBjZg==
4
+ ODk1ZmViNmZkOGQzMDQ2ODFlMGY4MzQ0NTQ1ZTM2NmMzZWI2ZDA2ZQ==
5
5
  data.tar.gz: !binary |-
6
- Mzk4N2ViMTVkYTA1ZjBiZmE5OTU1NDY0ODg4NGYyYWZhMGZjOGU0Nw==
6
+ ZjViYmUwMTUxMjExY2ZjMTM2MTUyZDM5YjIwMTc3NGJjZWZjMzBhOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTFkZDM3ZDFmNGNjZTA3MTM1NGJjYzg0YzI2YzNiYTgyZjBhMzIxZTI4MTEz
10
- YTM1NWRlYTFmMWRiZDUwMGM0MWU4NTk1NzhkMGM3N2ZhZDZiOGFjMzBkMGNl
11
- MzU3MTg5NDc5NjViMzk4YzYzOWMyZmU2NDNlNjdmYTAwY2M2Zjk=
9
+ ZjRlYjQ2OTVmOTkwM2MxMzgzMzU5YmVhNGJhYTM3ZDMxYWUxMzc3MmJlNjk0
10
+ MTlmMzUxM2QzNTgxMTA3ZDI5MWEzMzA4MTQyMjU0MzM4ZmQyMGQ3YTcwMDFh
11
+ MWQ5ZTBjNWU2MDMyNmE5N2IyODFjNmNhMGZiZGQ2NDQ0MjQzMTA=
12
12
  data.tar.gz: !binary |-
13
- NzI2OWU3MDFiY2ExMzU1ZDVkMjg4YzYyMGMyMTRmZmNjNzYyNmJkOGExODVm
14
- OGExMTFlNzJhODVhMWQ1OWYzYmY3OGJhNGE2ZTAyNjNjN2UyMDQ3MTQ1NGZh
15
- YjJiMTcyNWQ0MTI1YTA4N2QwNWU5ZDQzODNkMDI3OWQ1YzlkNjA=
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
@@ -19,6 +19,12 @@ module Caboose
19
19
  TYPE_VOID = 'void'
20
20
  TYPE_REFUND = 'refund'
21
21
 
22
+ after_initialize :check_nil_fields
23
+
24
+ def check_nil_fields
25
+ self.amount = 0.00 if self.amount.nil?
26
+ end
27
+
22
28
  end
23
29
  end
24
30
 
@@ -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
  #
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.106'
2
+ VERSION = '0.5.107'
3
3
  end
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.106
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
- ],