effective_resources 0.8.21 → 0.8.22
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea79be8241b1adfcfa31e764bc65c969bdaa1f44
|
4
|
+
data.tar.gz: 426a75287d398c5919e8763f367ab7b83f0793f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7499ad2d9c36efe72581c0a297350cff5e45615c92f629278e66829f4631365898e4b15a8487659ee7d725a5e03d2ffa831e610eb803b0ccbdda828f4ae8fbae
|
7
|
+
data.tar.gz: 90da0e9fd065300b63d953e4b2b33cc93f35701693b3c1731760ff7d9331528f9e693063bd872757b6491b2e55b564006878c5484693eb571445610a462c16b4
|
@@ -117,6 +117,8 @@ module Effective
|
|
117
117
|
# Just add a member action to your routes, you shouldn't need to call this directly
|
118
118
|
def member_action(action)
|
119
119
|
define_method(action) do
|
120
|
+
Rails.logger.info 'Processed by Effective::CrudController#member_action'
|
121
|
+
|
120
122
|
self.resource ||= resource_scope.find(params[:id])
|
121
123
|
|
122
124
|
EffectiveResources.authorize!(self, action, resource)
|
@@ -133,6 +135,8 @@ module Effective
|
|
133
135
|
# You shouldn't need to call this directly
|
134
136
|
def collection_action(action)
|
135
137
|
define_method(action) do
|
138
|
+
Rails.logger.info 'Processed by Effective::CrudController#collection_action'
|
139
|
+
|
136
140
|
if params[:ids].present?
|
137
141
|
self.resources ||= resource_scope.where(id: params[:ids])
|
138
142
|
end
|
@@ -153,6 +157,8 @@ module Effective
|
|
153
157
|
end
|
154
158
|
|
155
159
|
def index
|
160
|
+
Rails.logger.info ' Processed by Effective::CrudController#index'
|
161
|
+
|
156
162
|
@page_title ||= resource_plural_name.titleize
|
157
163
|
EffectiveResources.authorize!(self, :index, resource_klass)
|
158
164
|
|
@@ -167,6 +173,8 @@ module Effective
|
|
167
173
|
end
|
168
174
|
|
169
175
|
def new
|
176
|
+
Rails.logger.info ' Processed by Effective::CrudController#new'
|
177
|
+
|
170
178
|
self.resource ||= resource_scope.new
|
171
179
|
|
172
180
|
self.resource.assign_attributes(
|
@@ -193,6 +201,8 @@ module Effective
|
|
193
201
|
end
|
194
202
|
|
195
203
|
def create
|
204
|
+
Rails.logger.info ' Processed by Effective::CrudController#create'
|
205
|
+
|
196
206
|
self.resource ||= resource_scope.new
|
197
207
|
|
198
208
|
@page_title ||= "New #{resource_name.titleize}"
|
@@ -229,6 +239,8 @@ module Effective
|
|
229
239
|
end
|
230
240
|
|
231
241
|
def show
|
242
|
+
Rails.logger.info ' Processed by Effective::CrudController#show'
|
243
|
+
|
232
244
|
self.resource ||= resource_scope.find(params[:id])
|
233
245
|
|
234
246
|
@page_title ||= resource.to_s
|
@@ -238,6 +250,8 @@ module Effective
|
|
238
250
|
end
|
239
251
|
|
240
252
|
def edit
|
253
|
+
Rails.logger.info ' Processed by Effective::CrudController#edit'
|
254
|
+
|
241
255
|
self.resource ||= resource_scope.find(params[:id])
|
242
256
|
|
243
257
|
@page_title ||= "Edit #{resource}"
|
@@ -247,6 +261,8 @@ module Effective
|
|
247
261
|
end
|
248
262
|
|
249
263
|
def update
|
264
|
+
Rails.logger.info ' Processed by Effective::CrudController#update'
|
265
|
+
|
250
266
|
self.resource ||= resource_scope.find(params[:id])
|
251
267
|
|
252
268
|
@page_title = "Edit #{resource}"
|
@@ -281,6 +297,8 @@ module Effective
|
|
281
297
|
end
|
282
298
|
|
283
299
|
def destroy
|
300
|
+
Rails.logger.info ' Processed by Effective::CrudController#destroy'
|
301
|
+
|
284
302
|
self.resource = resource_scope.find(params[:id])
|
285
303
|
|
286
304
|
action = :destroy
|
@@ -436,7 +454,7 @@ module Effective
|
|
436
454
|
def resource_flash(status, resource, action)
|
437
455
|
submit = commit_action(action)
|
438
456
|
message = submit[status].respond_to?(:call) ? instance_exec(&submit[status]) : submit[status]
|
439
|
-
return if message.present?
|
457
|
+
return message if message.present?
|
440
458
|
|
441
459
|
case status
|
442
460
|
when :success then flash_success(resource, action)
|
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.22
|
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-06-
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|