effective_resources 0.8.19 → 0.8.20

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
  SHA1:
3
- metadata.gz: 5227cd81c0ab72a5764f6e0f0d9f34fdc0619838
4
- data.tar.gz: d30f8ea5e36ec64c34aec2b9e85c9e313029d0f2
3
+ metadata.gz: 8c20c9e42e4206b6cf9471061c5c559a991f994a
4
+ data.tar.gz: 8512766ecb15f9520c7afe8333f3ab9bf3b62835
5
5
  SHA512:
6
- metadata.gz: 81ffdd31a4ca269fcfccb636fa1800f8fb50590cdd070190384b979f1b3d00d61828abd3dc12f60d6081f5723a3529b7321ab200b21d8673799a562f22deb6ac
7
- data.tar.gz: 8a570e966b5f190f3c594186a1151797b38d21dfd99a8eb2d60f5b8a03b5feac7a0a26d023e437e18f18c4347a2f204b36d748928aa1b2aa3f64b9f022cc0c96
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
- EffectiveDatatables.authorize!(self, :index, resource_klass)
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(self, resource_datatable_attributes)
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 }&.last ||
566
- self.class.submits.find { |_, v| v[:action] == :save }&.last ||
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&.to_sym
49
+ namespace ||= effective_resource.namespace.to_sym if effective_resource.namespace
50
50
 
51
51
  partial = case partial
52
52
  when String
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.8.19'.freeze
2
+ VERSION = '0.8.20'.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: 0.8.19
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-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails