templus_models 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/crud_controller.rb +6 -6
- data/lib/templus_models/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 645a6997bc5923f9f20dc3a97dba19a737e1c847
|
4
|
+
data.tar.gz: 13baccd965afa06ac28ee7b414fcd5456b5cd130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 050db1a65973e7b67e9b6843de353c37a4079057c716f9bca19843e38b645c81b7b72eaef5e409351c750fb4fb86af9d2d38a0ac7e4e6c6b0dbd111cd6ef0902
|
7
|
+
data.tar.gz: 14aeba7451d36a7b316cfb764a9e85186b742aa7b5f810afdf9535da848304090e617b7a3d681bbb8b8e3b23080ee84aa86df6b2b7aefb98e563330d74f31306
|
@@ -34,9 +34,9 @@ class CrudController < ApplicationController
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
if respond_to?(:current_usuario)
|
37
|
-
@records = @q.result
|
37
|
+
@records = @q.result.accessible_by(current_ability, :read).page(params[:page]).per(@crud_helper.per_page)
|
38
38
|
else
|
39
|
-
@records = @q.result
|
39
|
+
@records = @q.result.page(params[:page]).per(@crud_helper.per_page)
|
40
40
|
end
|
41
41
|
@titulo = @model.name.pluralize
|
42
42
|
render partial: 'records' if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
|
@@ -136,9 +136,9 @@ class CrudController < ApplicationController
|
|
136
136
|
@q = @resource.search(params[:q])
|
137
137
|
@q.sorts = 'updated_at desc' if @q.sorts.empty?
|
138
138
|
if respond_to?(:current_usuario)
|
139
|
-
results = @q.result
|
139
|
+
results = @q.result.accessible_by(current_ability).page(params[:page])
|
140
140
|
else
|
141
|
-
results = @q.result
|
141
|
+
results = @q.result.page(params[:page])
|
142
142
|
end
|
143
143
|
instance_variable_set("@#{params[:var]}", results)
|
144
144
|
if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
|
@@ -156,9 +156,9 @@ class CrudController < ApplicationController
|
|
156
156
|
@q = @model.search(parametros)
|
157
157
|
@q.sorts = 'updated_at desc' if @q.sorts.empty?
|
158
158
|
if respond_to?(:current_usuario)
|
159
|
-
results = @q.result
|
159
|
+
results = @q.result.accessible_by(current_ability).page(params[:page])
|
160
160
|
else
|
161
|
-
results = @q.result
|
161
|
+
results = @q.result.page(params[:page])
|
162
162
|
end
|
163
163
|
method_label = params[:label]
|
164
164
|
render json: results.map {|result| {id: result.id, label: result.send(method_label), value: result.send(method_label)} }
|