effective_resources 1.15.1 → 1.17.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd950c2764b8af440fa475f4a99666009f28ea5c25f352d85d957ee2bf6ea5a3
|
4
|
+
data.tar.gz: 5fddb4399b3f8e7c8edb26c317dd561add0573bd1ba3dd7489c7f7fdf408b198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88867e25b814d72729e9746d12e6d5719a326f55f4097f593b3f2c888eddee003052bf1bea46d7a14e2c4e41cbd7128ec70155030341a2e6227d3a93bd69a647
|
7
|
+
data.tar.gz: d8086166e74b60cd6efaebc32705cdffb7940bf70686ded3c12a00b1a7e620ea529211e689b144763f0128bd4ab7c88e2aad37be491513449fabbac27e16e071
|
@@ -48,9 +48,12 @@ module ActsAsPurchasableWizard
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def find_or_build_submit_order
|
51
|
-
order = submit_order || orders.build(user: owner)
|
51
|
+
order = submit_order || orders.build(user: owner) # This is polymorphic user, might be an organization
|
52
52
|
fees = submit_fees().reject { |fee| fee.marked_for_destruction? }
|
53
53
|
|
54
|
+
# A membership could go from individual to organization
|
55
|
+
order.user = owner
|
56
|
+
|
54
57
|
# Adds fees, but does not overwrite any existing price.
|
55
58
|
fees.each do |fee|
|
56
59
|
order.add(fee) unless order.purchasables.include?(fee)
|
@@ -56,7 +56,23 @@ module ActsAsWizard
|
|
56
56
|
|
57
57
|
def required_steps
|
58
58
|
return self.class.test_required_steps if Rails.env.test? && self.class.test_required_steps.present?
|
59
|
-
|
59
|
+
|
60
|
+
steps = wizard_step_keys()
|
61
|
+
|
62
|
+
# Give the caller class a mechanism to change these.
|
63
|
+
# Used more in effective memberships
|
64
|
+
steps = change_wizard_steps(steps)
|
65
|
+
|
66
|
+
unless steps.kind_of?(Array) && steps.all? { |step| step.kind_of?(Symbol) }
|
67
|
+
raise('expected change_wizard_steps to return an Array of steps with no nils')
|
68
|
+
end
|
69
|
+
|
70
|
+
steps
|
71
|
+
end
|
72
|
+
|
73
|
+
# Intended for use by calling class
|
74
|
+
def change_wizard_steps(steps)
|
75
|
+
steps
|
60
76
|
end
|
61
77
|
|
62
78
|
# For use in the summary partials. Does not include summary.
|
@@ -21,7 +21,7 @@ module EffectiveResources
|
|
21
21
|
|
22
22
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
23
23
|
initializer 'effective_resources.active_record' do |app|
|
24
|
-
|
24
|
+
app.config.to_prepare do
|
25
25
|
ActiveRecord::Base.extend(ActsAsArchived::Base)
|
26
26
|
ActiveRecord::Base.extend(ActsAsEmailForm::Base)
|
27
27
|
ActiveRecord::Base.extend(ActsAsTokened::Base)
|
@@ -38,7 +38,7 @@ module EffectiveResources
|
|
38
38
|
end
|
39
39
|
|
40
40
|
initializer 'effective_resources.cancancan' do |app|
|
41
|
-
|
41
|
+
app.config.to_prepare do
|
42
42
|
if defined?(CanCan::Ability)
|
43
43
|
CanCan::Ability.module_eval do
|
44
44
|
CRUD_ACTIONS = [:index, :new, :create, :edit, :update, :show, :destroy]
|
@@ -57,17 +57,17 @@ module EffectiveResources
|
|
57
57
|
# Register the acts_as_archived routes concern
|
58
58
|
# resources :things, concerns: :acts_as_archived
|
59
59
|
initializer 'effective_resources.routes_concern' do |app|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
#ActiveSupport.on_load :action_controller_base do
|
64
|
-
#end
|
60
|
+
app.config.to_prepare do
|
61
|
+
ActionDispatch::Routing::Mapper.include(ActsAsArchived::RoutesConcern)
|
62
|
+
end
|
65
63
|
end
|
66
64
|
|
67
65
|
# Register the flash_messages concern so that it can be called in ActionController
|
68
66
|
initializer 'effective_resources.action_controller' do |app|
|
69
|
-
|
70
|
-
|
67
|
+
app.config.to_prepare do
|
68
|
+
ActiveSupport.on_load :action_controller do
|
69
|
+
include(Effective::FlashMessages)
|
70
|
+
end
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
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: 1.
|
4
|
+
version: 1.17.1
|
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: 2022-
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|