effective_orders 6.3.1 → 6.4.0

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: 79e445447643f3b8f6dc4d1580016faeb8fa2a55ec8c0ebe902b92b9e83861e7
4
- data.tar.gz: eeb3097f18e106737fa428099e1e20d26e4ac630dc0dafa3bac74640196d5ef8
3
+ metadata.gz: b6a326d583bd61702bc628143d2410df18b718a2664d0a890b770a080ac8b774
4
+ data.tar.gz: 3db513a6b48f22781475e64004d4505e67276d7fdbb2e4c31e14e72db6a73038
5
5
  SHA512:
6
- metadata.gz: d33e07601346e3dadc7edef24182911b23631a4b1d7ffd45c1c782f4060d2c45e50c6502dae447158649c23ec32fad30dfc19dcbabd5eb5bc123276acf5db81e
7
- data.tar.gz: 8c0b0a04fd6b39c111f09a998fe495b4e7ce2001d185b3eadca02700000f370027f682e189d1c2f0a8131fdb20081a99d8266904710bdf2a79b9827b2c6d0c48
6
+ metadata.gz: 03c9a070559a2cdd72f5fb035acaebfeaeffa453bdf05d45ef8fb0835babf72797304414cd0ea951ea16d209b16d2fd5432c85ff802ab7a1b209d9c3848021a7
7
+ data.tar.gz: 0f46f551e66b659cf52deb9ddaa6d6f3eaeba4a37691b10001e01eefae4a3f120c949c3a4ed1818e70d058ea5d812ac6eda3b03af8df8bdf65f16f3f2dd54e6b
@@ -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
@@ -31,6 +31,9 @@ module ActsAsPurchasable
31
31
  has_many :purchased_orders, -> { where(state: EffectiveOrders::PURCHASED).order(:purchased_at) },
32
32
  through: :order_items, class_name: 'Effective::Order', source: :order
33
33
 
34
+ has_many :deferred_orders, -> { where(state: EffectiveOrders::DEFERRED).order(:created_at) },
35
+ through: :order_items, class_name: 'Effective::Order', source: :order
36
+
34
37
  # Database max integer value is 2147483647. So let's round that down and use a max/min of $20 million (2000000000)
35
38
  validates :price, presence: true
36
39
  validates :price, numericality: { less_than_or_equal_to: 2000000000, message: 'maximum price is $20,000,000' }
@@ -96,6 +99,10 @@ module ActsAsPurchasable
96
99
  purchased_order_id.present?
97
100
  end
98
101
 
102
+ def deferred?
103
+ deferred_orders.any? { |order| order.deferred? }
104
+ end
105
+
99
106
  def purchased_at
100
107
  purchased_order.try(:purchased_at)
101
108
  end
@@ -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.1'.freeze
2
+ VERSION = '6.4.0'.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.1
4
+ version: 6.4.0
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-04-11 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails