rest_framework 0.6.1 → 0.6.2
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 +4 -2
- data/lib/rest_framework/paginators.rb +2 -1
- 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: 207b074408e0f95dd2d289abdd7d048f66f44d38f795b45b51245af28376a1c4
|
4
|
+
data.tar.gz: 67729758c21dd7627419248801d85f929188c64f2b20dba9095938a9650259da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd2c8c6209b04ffa77fe1506906332c9beb3e87ee60bad2f348ab5331258b46fe66fc3ced5048b66472c424b84132746fbca650b82faa87415c1a36b41c16c2
|
7
|
+
data.tar.gz: d04ceada0800c54161cfaeccb3d43251c3ae3bd5c629a937da058c0be640c0287453ac3338744d36e0290aea536b4987f56e76b0ace999580bd90adbd14d85c1
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
@@ -260,8 +260,10 @@ module RESTFramework::CreateModelMixin
|
|
260
260
|
|
261
261
|
def create!
|
262
262
|
if self.get_recordset.respond_to?(:create!) && self.create_from_recordset
|
263
|
-
# Create with any properties inherited from the recordset.
|
264
|
-
|
263
|
+
# Create with any properties inherited from the recordset. We exclude any `select` clauses in
|
264
|
+
# case model callbacks need to call `count` on this collection, which typically raises a SQL
|
265
|
+
# `SyntaxError`.
|
266
|
+
@record ||= self.get_recordset.except(:select).create!(self.get_create_params)
|
265
267
|
else
|
266
268
|
# Otherwise, perform a "bare" create.
|
267
269
|
@record ||= self.get_model.create!(self.get_create_params)
|
@@ -21,7 +21,8 @@ end
|
|
21
21
|
class RESTFramework::PageNumberPaginator < RESTFramework::BasePaginator
|
22
22
|
def initialize(**kwargs)
|
23
23
|
super
|
24
|
-
|
24
|
+
# Exclude any `select` clauses since that would cause `count` to fail with a SQL `SyntaxError`.
|
25
|
+
@count = @data.except(:select).count
|
25
26
|
@page_size = self._page_size
|
26
27
|
|
27
28
|
@total_pages = @count / @page_size
|
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.6.
|
4
|
+
version: 0.6.2
|
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-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|