effective_resources 2.9.7 → 2.10.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: 9db87dad7192ab5e49096eccdf4c6854ec0a0f9cd8ade4ba960fb668565b4358
4
- data.tar.gz: 17737a10fad18ec0281ce2d09fabfe0accfdd223d1df43d3a86514ac4d563a99
3
+ metadata.gz: 3f405113f520922715e551829d9059c36e923291a35a7ae254898dcbc609d96a
4
+ data.tar.gz: 67e9d68e3b45d9173e14d51da7a6f8d8c6c1fdf35b8e74bc204f1a8261b47f6c
5
5
  SHA512:
6
- metadata.gz: 39563c34df911a6a5fcfe1a04a684ad500111261fb22ff6db7673e14aefa1e5241ff955613adc9d78460237ae7fa5b43f2d1963f54ebb4df5dcff27bb0d2a144
7
- data.tar.gz: 030b4661abe84b50967fbe8ce04e7c06fa81572409816c2ae1eb9b77d94b1a246fb2ff310ad73dc66e35faa20994266c5c4f81b19e598aab91b7f05283b38a48
6
+ metadata.gz: 6ba2e27b1ef6e7ff8bdf4e154ef08b4b70687d8c5cae8e7907e4456c698769816bd70e4e2c9dd956f9197abccd225ca76b646bac0932ff72b70a8a1a32d754be
7
+ data.tar.gz: 697c1a6e458c761faeca1d96c527aba93d3814edd17169478828d6a9a56065ed917e98ed85e5419e15fd554eafadd8944efa48ca67d453f12ac6fce846f9c41c
@@ -121,7 +121,7 @@ module Effective
121
121
  datatable_klass = effective_resource.datatable_klass
122
122
  return unless datatable_klass.present?
123
123
 
124
- datatable = datatable_klass.new(resource_datatable_attributes)
124
+ datatable = EffectiveResources.best(datatable_klass.name).new(resource_datatable_attributes)
125
125
  datatable.effective_resource = effective_resource if datatable.respond_to?(:effective_resource=)
126
126
  datatable
127
127
  end
@@ -40,7 +40,7 @@ module ActsAsPurchasableWizard
40
40
  end
41
41
 
42
42
  def submit_order
43
- orders.first
43
+ orders.last
44
44
  end
45
45
 
46
46
  def find_or_build_submit_fees
@@ -49,6 +49,8 @@ module ActsAsPurchasableWizard
49
49
 
50
50
  def find_or_build_submit_order
51
51
  order = submit_order || orders.build(user: owner) # This is polymorphic user, might be an organization
52
+ order = orders.build(user: owner) if order.declined? # Make a new order, if the previous one was declined
53
+
52
54
  fees = submit_fees().reject { |fee| fee.marked_for_destruction? }
53
55
 
54
56
  # Make sure all Fees are valid
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.9.7'.freeze
2
+ VERSION = '2.10.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.7
4
+ version: 2.10.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-08-26 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails