effective_resources 2.9.4 → 2.9.5

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: e5238f51cc7e5066cef998e991f9905f4492419900004d5fdb488b782e475555
4
- data.tar.gz: 8673f4e1f7b1dfafdb482d5dbe76226da53911ee05b5117187e0affabdb81d69
3
+ metadata.gz: 31ab38dae78be5079c1f7312694e48d20f944df03f634ec327f61f053b2ecd90
4
+ data.tar.gz: af0850da493f9408108da574756ffc49b31e2013453160f7b863edb65df35d90
5
5
  SHA512:
6
- metadata.gz: dcb765e5931c64b5e56553046c498f21ff1e0dc54dffbd2d20df9107780401bdb31e50eedad950f09e21f6866a9383d038defb60babc51c378aede5a2aee166f
7
- data.tar.gz: de2b98efbba78404c14da1b7140723264e948cd2b601ff89ddaa8746da7ea247808a272e3f41deadcc4d81401c91c1719e4287b6096b0e32e87522684936a055
6
+ metadata.gz: ee7af38a7dd4128302fc3b480189837a6f51b5c5babc8308b1972b3501b28eaf82f4e94aea2803135037538edb34ba032bd2a81e9c18b103aa8536e6577b69bc
7
+ data.tar.gz: e2b4e7c3b1d23dc95b919627f9daae50ccaad2f2d87ae194601cb31b3c0e2054a23148b62ddf4e4d170f19bb6df06b1091ef0d5c00ef073c5f9f63e197a3387c
@@ -45,9 +45,11 @@ module Effective
45
45
  return if step == 'wicked_finish'
46
46
  return if resource.blank?
47
47
  return if resource.try(:done?)
48
- return unless resource_scope.respond_to?(:in_progress)
48
+ return unless resource_scope.respond_to?(:in_progress_for) || resource_scope.respond_to?(:in_progress)
49
+
50
+ in_progress = resource_scope.try(:in_progress_for, current_user) || resource_scope.try(:in_progress)
51
+ existing = in_progress.order(:id).where.not(id: resource).first
49
52
 
50
- existing = resource_scope.in_progress.order(:id).where.not(id: resource).first
51
53
  return unless existing.present?
52
54
  return if resource.persisted? && (existing.id > resource.id) # Otherwise we get an infinite loop
53
55
 
@@ -21,6 +21,18 @@ module ActsAsWizard
21
21
  end
22
22
  end
23
23
 
24
+ module ClassMethods
25
+ def acts_as_wizard?; true; end
26
+
27
+ def wizard_steps_hash
28
+ const_get(:WIZARD_STEPS)
29
+ end
30
+
31
+ def all_wizard_steps
32
+ const_get(:WIZARD_STEPS).keys
33
+ end
34
+ end
35
+
24
36
  included do
25
37
  acts_as_wizard_options = @acts_as_wizard_options
26
38
 
@@ -180,17 +192,6 @@ module ActsAsWizard
180
192
 
181
193
  end
182
194
 
183
- module ClassMethods
184
- def acts_as_wizard?; true; end
185
-
186
- def wizard_steps_hash
187
- const_get(:WIZARD_STEPS)
188
- end
189
195
 
190
- def all_wizard_steps
191
- const_get(:WIZARD_STEPS).keys
192
- end
193
-
194
- end
195
196
 
196
197
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.9.4'.freeze
2
+ VERSION = '2.9.5'.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.4
4
+ version: 2.9.5
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-24 00:00:00.000000000 Z
11
+ date: 2023-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails