effective_resources 1.16.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/concerns/effective/crud_controller.rb +5 -2
- data/app/models/concerns/acts_as_purchasable_wizard.rb +4 -1
- data/app/models/concerns/acts_as_wizard.rb +17 -1
- data/lib/effective_resources/engine.rb +6 -4
- data/lib/effective_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88760067301847f6d36a2f8550224e019acf06cc9fcc9021a7cf22799e09d560
|
4
|
+
data.tar.gz: 8a922371e95e9f9c91e1cd907b858f19316615508a05077ec5025c7c82c4e1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c19cbb3988ce98384ff670148617f5779337254fcaee5b4c68f354cd0d9a2bc40d15497db83c53d3f5dd9c37a9e13191f40bf3ed435a8607b05963e2678a292b
|
7
|
+
data.tar.gz: 96e9c5059d55ff3ad40a10f891fd8765eb9fee9d359d19809b1566a47dca26cbccde1f18e4f182f64740c2738134d6e08d93be7170add23ef917bed1631c7a9e
|
@@ -126,10 +126,13 @@ module Effective
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def resource_layout
|
129
|
+
namespace = controller_path.include?('admin/') ? 'admin' : 'application'
|
130
|
+
|
129
131
|
if defined?(Tenant)
|
130
|
-
|
131
|
-
"#{Tenant.current}/#{namespace}"
|
132
|
+
return "#{Tenant.current}/#{namespace}"
|
132
133
|
end
|
134
|
+
|
135
|
+
namespace
|
133
136
|
end
|
134
137
|
|
135
138
|
def resource_params_method_name
|
@@ -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]
|
@@ -64,8 +64,10 @@ module EffectiveResources
|
|
64
64
|
|
65
65
|
# Register the flash_messages concern so that it can be called in ActionController
|
66
66
|
initializer 'effective_resources.action_controller' do |app|
|
67
|
-
|
68
|
-
|
67
|
+
app.config.to_prepare do
|
68
|
+
ActiveSupport.on_load :action_controller do
|
69
|
+
include(Effective::FlashMessages)
|
70
|
+
end
|
69
71
|
end
|
70
72
|
end
|
71
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.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: 2022-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|