lotus_admin 1.5.1 → 1.5.2

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: 045cf584020f6a9ddb26bb32732a6c34d0a562d2691351fea2748acc07930140
4
- data.tar.gz: 7cb526a8e6abc0d62357d47d394a4d83b8ac02ebd6c31c42b1b464e7872911c0
3
+ metadata.gz: 1a6d6f7dab65888fc3cc1d0c1823baa23eb80d80605bc11c292bccff92f2242a
4
+ data.tar.gz: 72edd101b774056720d793cbab45c79f52519add43976762c1a32f1962719037
5
5
  SHA512:
6
- metadata.gz: fa06a04c853e7412efdc49d4f4f6b821cb8638dc962a485549881fbdb68ecd19a505ccb379405de262f2f3387186fdcfc8253daf0b23aebd3680d910c28da14c
7
- data.tar.gz: 61f92a76cfeedbd9e1d0d1353961716207baa72d10a7fece3dacd65d6e239902d94d107ae4ef52b4b07f9b229b94e73a44d3db9ae292ca09057116f43ff2fdb9
6
+ metadata.gz: 442cdf1f5eaf5ee45be321bfdf1dcbd0cf503101abf3a1f441e98521bb3d70a37b802e6526319edac810f46932ece767d389290fb379a27ff73ba87f917ed2f2
7
+ data.tar.gz: 7427bb13393baf8774e1be6bdc0613bccec45baaac602fb718e8abdedc659c4219bef7ad0b09b94a6c8a0e3bc7da890271635a2d6ca836b01513819512fb9f7c
@@ -4,6 +4,10 @@ module LotusAdmin
4
4
  render 'lotus_admin/shared/table/actions', resource: resource
5
5
  end
6
6
 
7
+ def undecorated(resource)
8
+ resource.try(:object).presence || resource
9
+ end
10
+
7
11
  def view_resource_item(resource)
8
12
  if policy(resource).show?
9
13
  content_tag(:li) { view_link(resource) }
@@ -29,7 +33,7 @@ module LotusAdmin
29
33
  end
30
34
 
31
35
  def view_link(resource)
32
- link_to lotus_admin.polymorphic_path(resource) do
36
+ link_to lotus_admin.polymorphic_path(undecorated(resource)) do
33
37
  content_tag(:i, nil, class: 'zmdi zmdi-eye')
34
38
  end
35
39
  end
@@ -41,13 +45,13 @@ module LotusAdmin
41
45
  end
42
46
 
43
47
  def edit_link(resource)
44
- link_to lotus_admin.edit_polymorphic_path(resource) do
48
+ link_to lotus_admin.edit_polymorphic_path(undecorated(resource)) do
45
49
  content_tag(:i, nil, class: 'zmdi zmdi-edit')
46
50
  end
47
51
  end
48
52
 
49
53
  def destroy_link(resource)
50
- link_to lotus_admin.polymorphic_path(resource), data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
54
+ link_to lotus_admin.polymorphic_path(undecorated(resource)), data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
51
55
  content_tag(:i, nil, class: 'zmdi zmdi-delete')
52
56
  end
53
57
  end
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '1.5.1'
2
+ VERSION = '1.5.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails