cm-admin 3.0.4 → 3.0.5

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: 5a4959d23e72acb3973b23cd3c275cc64545fa0d99a899d6315df73026fd889d
4
- data.tar.gz: dd2daf0d768d1dc01409383c1966905975bfdead82aa126909228ec9b88e90dc
3
+ metadata.gz: ccdee9067f16c0163a29773911a644dc8aa6db619a424941d249c772baaa965e
4
+ data.tar.gz: 928bdb9b4043d03a99873bd436d54be57ff55b3bd9b728e1b016fcdfe184e02d
5
5
  SHA512:
6
- metadata.gz: b323940b77edf010dd5079c53f2a17b5334c8e005f430a27097f9597e827343f5ab9342452a74060f9703d9c3ac7010454bdb99ace1353cf5679749a98f82cb3
7
- data.tar.gz: 412ff6701ea7ec48b982c8ee011fed1728ae9ac48334b80e7ca5b6f20f5a8d48d95d3f4f3c2ddbd3a945578b1baa84df4ecf026586ede4fb46783338abb20b2d
6
+ metadata.gz: 669c963c009987392eed2454e7168368b939e4ed76b9e47692e3b53221035fab221bf2ec1c743e2434d26a3e1d80323e81c7771098c5d538a7e923bff5162161
7
+ data.tar.gz: 11d176b610d4ee0992cb0bb6dbbe02838ea9ee8fda42c35e85b133b734dbdd2a2a6792b2cde710d3aed73dd79fc29392bb09787a44109481a275838a190bbfa5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (3.0.4)
4
+ cm-admin (3.0.5)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '3.0.4'
2
+ VERSION = '3.0.5'
3
3
  end
@@ -38,7 +38,8 @@ module CmAdmin
38
38
  end
39
39
 
40
40
  def custom_action_items(custom_action, current_action_name)
41
- return unless custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{custom_action.name}?")
41
+ action_name = "#{custom_action.name}?".to_sym
42
+ return unless custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).respond_to?(action_name) && policy([:cm_admin, @model.name.classify.constantize]).send(action_name)
42
43
 
43
44
  scoped_model = "CmAdmin::#{@model.name}Policy::#{custom_action.name.classify}Scope".constantize.new(Current.user, @model.name.constantize).resolve
44
45
  has_scoped_record = if current_action_name == 'index'
@@ -125,7 +126,7 @@ module CmAdmin
125
126
 
126
127
  def bulk_action_button(bulk_action)
127
128
  concat(content_tag(:li, class: 'bulk-action-item', data: { action: bulk_action.name }) do
128
- button_to cm_admin.send("#{@model.name.underscore}_#{bulk_action.name}_path"), method: :post, params: { selected_ids: '' }, class: 'bulk-action-button dropdown-item' do
129
+ button_to cm_admin.send("cm_#{bulk_action.name}_#{@model.name.underscore}_path"), method: :post, params: { selected_ids: '' }, class: 'bulk-action-button dropdown-item' do
129
130
  concat(content_tag(:div, class: 'bulk-action-icon') do
130
131
  concat(content_tag(:i, '', class: bulk_action.icon_name))
131
132
  end)
@@ -147,7 +148,7 @@ module CmAdmin
147
148
 
148
149
  def bulk_action_page(bulk_action)
149
150
  concat(content_tag(:li, class: 'bulk-action-item', data: { action: bulk_action.name }) do
150
- link_to cm_admin.send("#{@model.name.underscore}_#{bulk_action.name}_path", @ar_object, bulk_action.url_params), class: 'dropdown-item' do
151
+ link_to cm_admin.send("cm_#{bulk_action.name}_#{@model.name.underscore}_path", @ar_object, bulk_action.url_params), class: 'dropdown-item' do
151
152
  concat(content_tag(:div, class: 'bulk-action-icon') do
152
153
  concat(content_tag(:i, '', class: bulk_action.icon_name))
153
154
  end)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2024-10-24 00:00:00.000000000 Z
17
+ date: 2024-10-28 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: caxlsx_rails