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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f583953d5d2f3ae8574e79f598d0f5e0d49702ddc6283ba89803cdd5acb5a729
4
- data.tar.gz: d6769ee0cf4f93ae7577988cc9a3a0aecfb922594b2737692f1fa8d4c63657f3
3
+ metadata.gz: b7714ba549f6221376ea59469347cef85f96f45b839a0dbf1d148beb29403cd6
4
+ data.tar.gz: 61bf072c088a52094d55fa605907d8a9caf479ab68f60283d53e2bf76d5444b1
5
5
  SHA512:
6
- metadata.gz: 545ae15724af39ae7c344155c300ce533eee3c77bc4656a11792433902ea1d847f0bb2756b77ffaaf90206608ea675d9fbff284153804cff5d7a7a6baabb0dd5
7
- data.tar.gz: c27077e2f2677c96a4ee4d5fd0e7d2355dce481f23f719a17262b9372af492f4f189875fef1d156beafa42e48c3667e80f65641d07eb0bc529803dcc3a8874f9
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
- @resources = filtered_resources.paginate(page: page, per_page: per_page)
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
@@ -3,7 +3,7 @@
3
3
  module Zadok
4
4
  VERSION_MAJOR = 0
5
5
  VERSION_MINOR = 8
6
- VERSION_TINY = 13
6
+ VERSION_TINY = 14
7
7
  VERSION_PRE = nil
8
8
 
9
9
  VERSION = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zadok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leon Hooijer