rest_framework 0.0.14 → 0.0.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70c2eb85612656cf6f1b3d34b97deb06ad01aa07459012b4254e543fc0bd5507
|
4
|
+
data.tar.gz: 76f44db8c396cfe5bb539faebb6f6031276d7133327b733cab4a645922176d95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 246bd5c3972c212c1d6fcf600da1c894fe05acaeda8596d432b6b360e265520b3e54f3b4842998c26868464c29bd79f3c164f51104145163c0a63ba9e94f06fb
|
7
|
+
data.tar.gz: 52af9985b986a167f70cd8def492a3ff2c7d61bafd48e120f49934cc3827f76a1e6dbc5c02651df6bba7fdd622be058f945534415d6cb74e3537c56f9c18c0e2
|
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.15
|
@@ -20,6 +20,7 @@ module RESTFramework
|
|
20
20
|
:allowed_action_parameters,
|
21
21
|
:serializer_class,
|
22
22
|
:extra_member_actions,
|
23
|
+
:disable_creation_from_recordset,
|
23
24
|
])
|
24
25
|
base.alias_method(:extra_collection_actions=, :extra_actions=)
|
25
26
|
end
|
@@ -165,7 +166,13 @@ module RESTFramework
|
|
165
166
|
|
166
167
|
module CreateModelMixin
|
167
168
|
def create
|
168
|
-
|
169
|
+
if self.get_recordset.respond_to?(:create!) && !self.disable_creation_from_recordset
|
170
|
+
# Create with any properties inherited from the recordset (like associations).
|
171
|
+
@record = self.get_recordset.create!(self.get_create_params)
|
172
|
+
else
|
173
|
+
# Otherwise, perform a "bare" create.
|
174
|
+
@record = self.get_model.create!(self.get_create_params)
|
175
|
+
end
|
169
176
|
@serialized_record = self.get_serializer_class.new(
|
170
177
|
object: @record, controller: self
|
171
178
|
).serialize
|
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.0.
|
4
|
+
version: 0.0.15
|
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: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|