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: ab8e500690ee54da42755e6243047dcc2cd78706c96dae29e18510aef2f9829a
4
- data.tar.gz: 9e8c0990b2bf175effea734f306a806de6094984b6dca7cf2899c9c6e77bcc5a
3
+ metadata.gz: 70c2eb85612656cf6f1b3d34b97deb06ad01aa07459012b4254e543fc0bd5507
4
+ data.tar.gz: 76f44db8c396cfe5bb539faebb6f6031276d7133327b733cab4a645922176d95
5
5
  SHA512:
6
- metadata.gz: 730b8dcf9e9febb6d6adee7672a3bb1d8458498b6c17b1ec483878a5b8d28638a11f15c71745d9ba06d2eb41e64834a7e591390da3d5d64e1daa30b5244046b3
7
- data.tar.gz: 544814fbe3bc83bdd6661346bae020ce8f74a0ea8edab9180d88654e09d51b458f5eed5732916c58aff9961da6b6224776d9bc6aff9d01b6519ab0cfe5e2641c
6
+ metadata.gz: 246bd5c3972c212c1d6fcf600da1c894fe05acaeda8596d432b6b360e265520b3e54f3b4842998c26868464c29bd79f3c164f51104145163c0a63ba9e94f06fb
7
+ data.tar.gz: 52af9985b986a167f70cd8def492a3ff2c7d61bafd48e120f49934cc3827f76a1e6dbc5c02651df6bba7fdd622be058f945534415d6cb74e3537c56f9c18c0e2
@@ -1 +1 @@
1
- 0.0.14
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
- @record = self.get_model.create!(self.get_create_params)
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.14
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-10-28 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails