effective_resources 1.5.3 → 1.5.4
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 +4 -4
- data/app/models/effective/resources/controller.rb +17 -11
- data/lib/effective_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b4cbe9d018c7ea4cb40727d321530ba562c0ca873bea3c7e82492cd7d518b64
|
4
|
+
data.tar.gz: f1249c47c44c4095c30441aa636746f298c8591585e14ac948391693ea98cec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6ae58c5d781ff5ad6378ad6df6f8f5388dd33213fa57c1d2ea902b593d72088e60dbb551fd5185acd442354803c02383b53d7414304ea53740e6c0db5c9d74
|
7
|
+
data.tar.gz: 2df964ebabaa075f388d96ad5e78f9a5d5b27a2071b5320a4f1593fdb882fd717491ddc3ca66a84d027952ed4638f3fa817f48869a2d2d4c4870b831741f3d3f
|
@@ -31,22 +31,26 @@ module Effective
|
|
31
31
|
end
|
32
32
|
|
33
33
|
(member_post_actions - crud_actions).each do |action| # default true means it will be overwritten by dsl methods
|
34
|
-
|
34
|
+
action_name = action.to_s.titleize
|
35
|
+
|
36
|
+
buttons[action_name] = case action
|
35
37
|
when :archive
|
36
|
-
{ action: action, default: true, if: -> { !resource.archived? }, class: 'btn btn-danger', 'data-method' => :post, 'data-confirm' => "Really #{
|
38
|
+
{ action: action, default: true, if: -> { !resource.archived? }, class: 'btn btn-danger', 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?"}
|
37
39
|
when :unarchive
|
38
|
-
{ action: action, default: true, if: -> { resource.archived? }, 'data-method' => :post, 'data-confirm' => "Really #{
|
40
|
+
{ action: action, default: true, if: -> { resource.archived? }, 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?" }
|
39
41
|
else
|
40
|
-
{ action: action, default: true, 'data-method' => :post, 'data-confirm' => "Really #{
|
42
|
+
{ action: action, default: true, 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?"}
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
44
46
|
member_delete_actions.each do |action|
|
47
|
+
action_name = action.to_s.titleize
|
48
|
+
|
45
49
|
if action == :destroy
|
46
50
|
next if buttons.values.find { |v| v[:action] == :archive }.present?
|
47
51
|
buttons['Delete'] = { action: action, default: true, 'data-method' => :delete, 'data-confirm' => "Really delete @resource?" }
|
48
52
|
else
|
49
|
-
buttons[
|
53
|
+
buttons[action_name] = { action: action, default: true, 'data-method' => :delete, 'data-confirm' => "Really #{action_name} @resource?" }
|
50
54
|
end
|
51
55
|
end
|
52
56
|
|
@@ -81,24 +85,26 @@ module Effective
|
|
81
85
|
member_post_actions.each do |action|
|
82
86
|
next if crud_actions.include?(action)
|
83
87
|
|
84
|
-
|
88
|
+
action_name = action.to_s.titleize
|
85
89
|
|
86
|
-
actions[
|
90
|
+
actions[action_name] = case action
|
87
91
|
when :archive
|
88
|
-
{ action: action, default: true, if: -> { !resource.archived? }, class: 'btn btn-danger', 'data-method' => :post, 'data-confirm' => "Really #{
|
92
|
+
{ action: action, default: true, if: -> { !resource.archived? }, class: 'btn btn-danger', 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?"}
|
89
93
|
when :unarchive
|
90
|
-
{ action: action, default: true, if: -> { resource.archived? }, 'data-method' => :post, 'data-confirm' => "Really #{
|
94
|
+
{ action: action, default: true, if: -> { resource.archived? }, 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?" }
|
91
95
|
else
|
92
|
-
{ action: action, default: true, 'data-method' => :post, 'data-confirm' => "Really #{
|
96
|
+
{ action: action, default: true, 'data-method' => :post, 'data-confirm' => "Really #{action_name} @resource?" }
|
93
97
|
end
|
94
98
|
end
|
95
99
|
|
96
100
|
member_delete_actions.each do |action|
|
101
|
+
action_name = action.to_s.titleize
|
102
|
+
|
97
103
|
if action == :destroy
|
98
104
|
next if actions.find { |_, v| v[:action] == :archive }.present?
|
99
105
|
actions['Delete'] = { action: action, default: true, 'data-method' => :delete, 'data-confirm' => "Really delete @resource?" }
|
100
106
|
else
|
101
|
-
actions[
|
107
|
+
actions[action_name] = { action: action, default: true, 'data-method' => :delete, 'data-confirm' => "Really #{action_name} @resource?" }
|
102
108
|
end
|
103
109
|
end
|
104
110
|
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: 1.5.
|
4
|
+
version: 1.5.4
|
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: 2020-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|