effective_orders 6.3.0 → 6.3.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: 6bf799fd1e295b06b3e96d6083298bc3d56af80d2e5fc45aee9a3c45026e13bc
4
- data.tar.gz: b03d84f686b369b97052b17f5b204b029d5ff79ab67bb8dd095e2b86a36af4be
3
+ metadata.gz: dcf54cb263731e52d92dde70fa2035f84ed936cdffedc4e4fb204812270f9ac6
4
+ data.tar.gz: 3c12854db2e85a59e269b9e804de2828973b95e361add948012863146a181359
5
5
  SHA512:
6
- metadata.gz: d96a318e778addc0d4174320c64fb54a0cf2c1e79fb0e4ea2286f69b5330562b08bdce127d9a4e02faae31afee9ebe1a1f0e043586623b92416c0256ced24d45
7
- data.tar.gz: 6750bfa2d3c93be7cf208b0f8cc84dc355f7aab77a02553451e78d6c6a0b7ce10289ca8e4ca40ed1b93bf80594f40bc37b51d4b215d2742036565ef75b499b44
6
+ metadata.gz: e627ddb5abcd86a77e66ad3ac4d880b83379fc7ed5d45188ffa662675d4fbdecbd6d1af05b4cae63a32334d529fea0a57ca7c14ef7aa9de7b59fa57bcb1de436
7
+ data.tar.gz: 32fe71842c0c28eb5c27e205fec73f065eaace30de1480f3ce7e07554306180522d35f02c5c7c08a6a3e63ae67cdb1b8c028f58af2a107fb4e12f8e3f982bbbc
@@ -19,6 +19,8 @@ module Admin
19
19
  col :purchased_at
20
20
  col :user
21
21
  col :order_items
22
+ col :payment_provider, search: EffectiveOrders.payment_providers
23
+ col :payment_method
22
24
 
23
25
  col :subtotal, as: :price
24
26
  col :tax, as: :price
@@ -80,7 +80,7 @@ module ActsAsPurchasable
80
80
  elsif value.blank?
81
81
  super
82
82
  else
83
- raise 'expected price to be an Integer representing the number of cents.'
83
+ raise "expected price to be an Integer representing the number of cents. Got: #{value}"
84
84
  end
85
85
  end
86
86
 
@@ -116,14 +116,11 @@ module Effective
116
116
 
117
117
  # Price validations
118
118
  validates :subtotal, presence: true
119
+ validates :total, presence: true, if: -> { EffectiveOrders.minimum_charge.to_i > 0 }
119
120
 
120
- with_options(if: -> { EffectiveOrders.minimum_charge.to_i > 0 }) do
121
- validates :total, presence: true
122
-
123
- validate(unless: -> { (free? && EffectiveOrders.free?) || (refund? && EffectiveOrders.refund?) }) do
124
- if total.present? && total < EffectiveOrders.minimum_charge
125
- errors.add(:total, "must be $#{'%0.2f' % (EffectiveOrders.minimum_charge.to_i / 100.0)} or more. Please add additional items.")
126
- end
121
+ validate(if: -> { total.present? && EffectiveOrders.minimum_charge.to_i > 0 }, unless: -> { purchased? || (free? && EffectiveOrders.free?) || (refund? && EffectiveOrders.refund?) }) do
122
+ if total < EffectiveOrders.minimum_charge
123
+ errors.add(:total, "must be $#{'%0.2f' % (EffectiveOrders.minimum_charge.to_i / 100.0)} or more. Please add additional items.")
127
124
  end
128
125
  end
129
126
 
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Effective
4
+ # An Order Item
2
5
  class OrderItem < ActiveRecord::Base
3
6
  self.table_name = EffectiveOrders.order_items_table_name.to_s
4
7
 
@@ -9,9 +12,7 @@ module Effective
9
12
 
10
13
  log_changes(to: :order) if respond_to?(:log_changes)
11
14
 
12
- if defined?(EffectiveQbSync)
13
- has_one :qb_order_item
14
- end
15
+ has_one :qb_order_item if defined?(EffectiveQbSync)
15
16
 
16
17
  effective_resource do
17
18
  name :string
@@ -1,3 +1,4 @@
1
1
  %h1.effective-admin-heading= @page_title
2
2
 
3
- = render_datatable(@datatable)
3
+ = card do
4
+ = render_datatable(@datatable)
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.3.0'.freeze
2
+ VERSION = '6.3.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: 6.3.0
4
+ version: 6.3.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: 2023-03-22 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails