autoforme 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/MIT-LICENSE +1 -1
- data/lib/autoforme/frameworks/roda.rb +1 -1
- data/lib/autoforme/frameworks/sinatra.rb +1 -1
- data/lib/autoforme/models/sequel.rb +11 -1
- data/lib/autoforme/version.rb +1 -1
- data/lib/roda/plugins/autoforme.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bff68076c7cdf213c0142df9ab3809d33ede301c99f12e5cfbe7d1e111df30d
|
4
|
+
data.tar.gz: d2446bc814e6a19ebb70dfd46717ac596bb0aa4915abf02dd83aded973ba8d65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '048c064a080ae50bd872be8e17a96f06e6f9eece5fb095c31121810edbe2f03d1f5db7a6562fb0d33c7229b1e1a49641246186f6567435664be646da836ce251'
|
7
|
+
data.tar.gz: 596b1caa6bfc6a91cf8745019df9c299e9315ace558388c9c5ba4fb44b7df18fdfd0aff0c9e5a7213c71e26ffb3fa12d3afed34e91c962e1ae258254413cded4
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 1.13.0 (2024-07-10)
|
2
|
+
|
3
|
+
* Typecast primary key values before using them for lookup (jeremyevans)
|
4
|
+
|
5
|
+
* Support colon for model names to allow easier use of namespaced models (adam12) (#46)
|
6
|
+
|
1
7
|
=== 1.12.0 (2022-06-29)
|
2
8
|
|
3
9
|
* Handle autocomplete queries with an empty query by returning empty string (jeremyevans)
|
data/MIT-LICENSE
CHANGED
@@ -133,6 +133,12 @@ module AutoForme
|
|
133
133
|
|
134
134
|
# Retrieve underlying model instance with matching primary key
|
135
135
|
def with_pk(type, request, pk)
|
136
|
+
begin
|
137
|
+
pk = typecast_value(model.primary_key, pk)
|
138
|
+
rescue S::InvalidValue
|
139
|
+
raise S::NoMatchingRow
|
140
|
+
end
|
141
|
+
|
136
142
|
dataset_for(type, request).with_pk!(pk)
|
137
143
|
end
|
138
144
|
|
@@ -183,7 +189,7 @@ module AutoForme
|
|
183
189
|
ds = ds.where(S.ilike(S.qualify(model.table_name, c), "%#{ds.escape_like(v)}%"))
|
184
190
|
else
|
185
191
|
begin
|
186
|
-
typecasted_value =
|
192
|
+
typecasted_value = typecast_value(c, v)
|
187
193
|
rescue S::InvalidValue
|
188
194
|
ds = ds.where(false)
|
189
195
|
break
|
@@ -355,6 +361,10 @@ module AutoForme
|
|
355
361
|
|
356
362
|
private
|
357
363
|
|
364
|
+
def typecast_value(column, value)
|
365
|
+
model.db.typecast_value(column_type(column), value)
|
366
|
+
end
|
367
|
+
|
358
368
|
def dataset_for(type, request)
|
359
369
|
ds = model.dataset
|
360
370
|
if filter = filter_for
|
data/lib/autoforme/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoforme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forme
|
@@ -251,7 +251,7 @@ metadata:
|
|
251
251
|
documentation_uri: http://autoforme.jeremyevans.net
|
252
252
|
mailing_list_uri: https://github.com/jeremyevans/autoforme/discussions
|
253
253
|
source_code_uri: https://github.com/jeremyevans/autoforme
|
254
|
-
post_install_message:
|
254
|
+
post_install_message:
|
255
255
|
rdoc_options:
|
256
256
|
- "--quiet"
|
257
257
|
- "--line-numbers"
|
@@ -273,8 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
rubygems_version: 3.
|
277
|
-
signing_key:
|
276
|
+
rubygems_version: 3.5.11
|
277
|
+
signing_key:
|
278
278
|
specification_version: 4
|
279
279
|
summary: Web Administrative Console for Roda/Sinatra/Rails and Sequel::Model
|
280
280
|
test_files: []
|