rest_framework 0.5.7 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9e50f091ca2fab796992252f39a700ab1c22ad89b50953654240ac5273cd7ac
4
- data.tar.gz: ed46ccce3fb8986f207f5b8e996f1a9577e58834f70fcc7de0c36a3e54b8f65f
3
+ metadata.gz: 365696e92f267b3c3547bc6fed9ad2cfcbc1a3cc769ee7128332cc469a534eec
4
+ data.tar.gz: bde678de3e2c11847f3777b057b5d267f75185c23a997fe704acaab6a36ad23d
5
5
  SHA512:
6
- metadata.gz: ed76863c305eb92f712affbb0d43b1470c518f933226a86c60983690edf5846faadc7dca0278d1075ed903d6637b45c4eeff1788e00ef130ec49457f94dba4f4
7
- data.tar.gz: 16b12ff971d7201669d0114804e8664dc641065c771c4cb34ba1ac21899f1fd14fd396d363f76619a58dba67688b88e35ae69b34be80e4975b6f94cfe6760c67
6
+ metadata.gz: 527ffee7ac29d26d0405c6ff6dba94c2d5d7e8ba505b2c6f42860fb67d782fc2b180ddaeb462947b918b84818fd30633a8290bde5d2558ced238b5a28bd9eab8
7
+ data.tar.gz: 6d56d27874e79beea8ce627fc85b0841e3a2d1cc864a7664a07ef54279216e8da80f13061ed07f3761c1da9ae570906387331c21f946c9bef102adab2bb56b6c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.7
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
- return (
74
- _get_specific_action_config(:action_fields, :fields) || self.get_model&.column_names || []
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 model fields.
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.5.7
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-06-29 00:00:00.000000000 Z
11
+ date: 2022-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails