effective_resources 0.8.19 → 0.8.20
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c20c9e42e4206b6cf9471061c5c559a991f994a
|
|
4
|
+
data.tar.gz: 8512766ecb15f9520c7afe8333f3ab9bf3b62835
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36543a89d0759669b02903f7c75db66f14c614822c082d453235004e22df48cda7c6fb4e1373cf0cf1349a05ac0f4a9cd4495688e18280626a7ba56d135e7cd7
|
|
7
|
+
data.tar.gz: b17cbdf2b9ae1dde362b317435d42e08155f98769a3ab06c6de5512fd9b5d09a28ba1a222fdeb0da91160b70d2df516831280ccf4bb690f9103626b1b350c406
|
|
@@ -154,12 +154,13 @@ module Effective
|
|
|
154
154
|
|
|
155
155
|
def index
|
|
156
156
|
@page_title ||= resource_plural_name.titleize
|
|
157
|
-
|
|
157
|
+
EffectiveResources.authorize!(self, :index, resource_klass)
|
|
158
158
|
|
|
159
159
|
self.resources ||= resource_scope.all
|
|
160
160
|
|
|
161
161
|
if resource_datatable_class
|
|
162
|
-
@datatable ||= resource_datatable_class.new(
|
|
162
|
+
@datatable ||= resource_datatable_class.new(resource_datatable_attributes)
|
|
163
|
+
@datatable.view = view_context
|
|
163
164
|
end
|
|
164
165
|
|
|
165
166
|
run_callbacks(:resource_render)
|
|
@@ -562,8 +563,8 @@ module Effective
|
|
|
562
563
|
def commit_action(action = nil)
|
|
563
564
|
self.class.submits[params[:commit].to_s] ||
|
|
564
565
|
self.class.submits[action.to_s] ||
|
|
565
|
-
self.class.submits.find { |_, v| v[:action] == action }
|
|
566
|
-
self.class.submits.find { |_, v| v[:action] == :save }
|
|
566
|
+
self.class.submits.find { |_, v| v[:action] == action }.try(:last) ||
|
|
567
|
+
self.class.submits.find { |_, v| v[:action] == :save }.try(:last) ||
|
|
567
568
|
{ action: (action || :save) }
|
|
568
569
|
end
|
|
569
570
|
|
|
@@ -46,7 +46,7 @@ module EffectiveResourcesHelper
|
|
|
46
46
|
effective_resource ||= Effective::Resource.new(controller_path)
|
|
47
47
|
raise 'Expected resource: value to be an Effective::Resource instance' unless effective_resource.kind_of?(Effective::Resource)
|
|
48
48
|
|
|
49
|
-
namespace ||= effective_resource.namespace
|
|
49
|
+
namespace ||= effective_resource.namespace.to_sym if effective_resource.namespace
|
|
50
50
|
|
|
51
51
|
partial = case partial
|
|
52
52
|
when String
|
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: 0.8.
|
|
4
|
+
version: 0.8.20
|
|
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: 2018-
|
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|