zadok 0.8.13 → 0.8.14
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/controllers/zadok_controller.rb +11 -3
- data/lib/zadok/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7714ba549f6221376ea59469347cef85f96f45b839a0dbf1d148beb29403cd6
|
4
|
+
data.tar.gz: 61bf072c088a52094d55fa605907d8a9caf479ab68f60283d53e2bf76d5444b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b41216bf8548750973cbbd8a0ff5ee5d6cedcb8d71c741b76ff8381566737831f54f9035abec26be783bd6eadd112510b2c56800bee86cdaa86ec2c83dd7de7
|
7
|
+
data.tar.gz: c886852ecda0301f509ba74f2131131e6996c1ef2324d0e0e15fb22dedc5f48197640582e255be27285d443efe5543fcd394cc74ef4b2daa343401388258da85
|
@@ -112,6 +112,10 @@ class ZadokController < ApplicationController
|
|
112
112
|
params.permit(:page, :per_page, q: %i[s search_model])
|
113
113
|
end
|
114
114
|
|
115
|
+
define_method("#{controller_name.singularize}_params") do
|
116
|
+
params.require(controller_name.singularize).permit!
|
117
|
+
end
|
118
|
+
|
115
119
|
def resource_params
|
116
120
|
send("#{controller_name.singularize}_params")
|
117
121
|
end
|
@@ -152,7 +156,7 @@ class ZadokController < ApplicationController
|
|
152
156
|
end
|
153
157
|
|
154
158
|
def filter_and_paginate_resources!
|
155
|
-
|
159
|
+
instance_variable_set("@#{controller_name}", filtered_resources.paginate(page: page, per_page: per_page))
|
156
160
|
end
|
157
161
|
|
158
162
|
def show_attributes
|
@@ -166,16 +170,20 @@ class ZadokController < ApplicationController
|
|
166
170
|
def new_attributes
|
167
171
|
Hash[
|
168
172
|
resource_class.attribute_types.map do |attr, type|
|
173
|
+
next if attr.in?(%w[id created_at updated_at])
|
174
|
+
|
169
175
|
[attr, { type: type.class.name.demodulize.underscore }]
|
170
|
-
end
|
176
|
+
end.compact
|
171
177
|
]
|
172
178
|
end
|
173
179
|
|
174
180
|
def edit_attributes
|
175
181
|
Hash[
|
176
182
|
resource_class.attribute_types.map do |attr, type|
|
183
|
+
next if attr.in?(%w[id created_at updated_at])
|
184
|
+
|
177
185
|
[attr, { type: type.class.name.demodulize.underscore }]
|
178
|
-
end
|
186
|
+
end.compact
|
179
187
|
]
|
180
188
|
end
|
181
189
|
|
data/lib/zadok/version.rb
CHANGED