rest_framework 0.5.7 → 0.6.0
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/VERSION +1 -1
- data/lib/rest_framework/controller_mixins/models.rb +9 -4
- data/lib/rest_framework/serializers.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 365696e92f267b3c3547bc6fed9ad2cfcbc1a3cc769ee7128332cc469a534eec
|
4
|
+
data.tar.gz: bde678de3e2c11847f3777b057b5d267f75185c23a997fe704acaab6a36ad23d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 527ffee7ac29d26d0405c6ff6dba94c2d5d7e8ba505b2c6f42860fb67d782fc2b180ddaeb462947b918b84818fd30633a8290bde5d2558ced238b5a28bd9eab8
|
7
|
+
data.tar.gz: 6d56d27874e79beea8ce627fc85b0841e3a2d1cc864a7664a07ef54279216e8da80f13061ed07f3761c1da9ae570906387331c21f946c9bef102adab2bb56b6c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -69,10 +69,15 @@ module RESTFramework::BaseModelControllerMixin
|
|
69
69
|
end
|
70
70
|
|
71
71
|
# Get a list of fields for the current action.
|
72
|
-
def get_fields
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
def get_fields(fallback: true)
|
73
|
+
action_fields = _get_specific_action_config(:action_fields, :fields)
|
74
|
+
|
75
|
+
# Typically we want to fallback to either the DB dolumns or an empty array.
|
76
|
+
if fallback
|
77
|
+
action_fields ||= self.get_model&.column_names || []
|
78
|
+
end
|
79
|
+
|
80
|
+
return action_fields
|
76
81
|
end
|
77
82
|
|
78
83
|
# Get a list of find_by fields for the current action.
|
@@ -212,8 +212,8 @@ class RESTFramework::NativeSerializer < RESTFramework::BaseSerializer
|
|
212
212
|
return serializer_config.deep_dup
|
213
213
|
end
|
214
214
|
|
215
|
-
# If the config wasn't determined, build a serializer config from
|
216
|
-
fields = @controller.get_fields if @controller
|
215
|
+
# If the config wasn't determined, build a serializer config from controller fields.
|
216
|
+
fields = @controller.get_fields(fallback: false) if @controller
|
217
217
|
if fields
|
218
218
|
fields = fields.deep_dup
|
219
219
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory N. Schmit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|