effective_resources 1.17.0 → 1.18.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85d51e9a321bc50d365988828721b264bd2ef27476a9d3cb3650217f5b130e3
|
4
|
+
data.tar.gz: a98e8d5ba21daa4519e5167b7c19a07bc61d4a3fc21d1b297e67eb19f558dc3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e8cf35a3218e404cb37510c2c3b0bfb966a73f85850cd5cd5f7aced1ea024dd505b07f1994d58b5ed2ad81c8ca1daf16898f9bd26c1d88f4fe57ce4c21e278d
|
7
|
+
data.tar.gz: c6fdf528e8a9f8ace078e51410483b0d4f8f4c2bddb367b0559ccc7965181d58668acad33db847c32484e3e215464390df7c01728fd4c8a8cd8064a76432a5bf
|
@@ -60,7 +60,9 @@ module Effective
|
|
60
60
|
when ActiveRecord::StaleObjectError
|
61
61
|
flash.now[:danger] = "#{flash.now[:danger]} <a href='#', class='alert-link' onclick='window.location.reload(true); return false;'>reload page and try again</a>"
|
62
62
|
raise(ActiveRecord::Rollback) # This is a soft error, we want to display the flash message to user
|
63
|
-
when Effective::ActionFailed
|
63
|
+
when Effective::ActionFailed
|
64
|
+
# Nothing to do
|
65
|
+
when ActiveRecord::RecordInvalid, RuntimeError
|
64
66
|
raise(ActiveRecord::Rollback) # This is a soft error, we want to display the flash message to user
|
65
67
|
else
|
66
68
|
raise(e) # This is a real error that should be sent to 500. Client should not see the message.
|
@@ -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
|
@@ -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.18.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: 2022-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|