toast 1.1.0 → 1.1.1
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/lib/toast/collection_request.rb +2 -5
- data/lib/toast/plural_assoc_request.rb +1 -2
- data/lib/toast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a6abb704a427b250f834207658a733b8bacedf
|
4
|
+
data.tar.gz: 2d7994ff30427fc8e1bfa1eb5cff1be83019f7e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d791670e8698a667d462841d2ff374f84fa71b355131796cf0547d57a78a12f523115cc327d6e52cf22f467a66f7724361736c536cade3a51e6fdc03a47de3fe
|
7
|
+
data.tar.gz: 23be4cf6a59aa885c470f59de9bffe88d323d7075a9370e8a1d2913313f5bcfceaac54f9575f2c6caefc3cc78fc339ada92680ace8f6d47779fc97262e98f32e
|
@@ -49,14 +49,11 @@ class Toast::CollectionRequest
|
|
49
49
|
@auth, relation, @uri_params)
|
50
50
|
|
51
51
|
if relation.is_a?(ActiveRecord::Relation) and
|
52
|
-
relation.model
|
52
|
+
relation.model== @config.base_model_class
|
53
53
|
|
54
54
|
result = relation.limit(window).offset(range_start)
|
55
55
|
|
56
|
-
|
57
|
-
# fix problematic select extensions for counting (-> { select(...) })
|
58
|
-
# this fails if the where clause depends on the the extended select
|
59
|
-
count = relation.count_by_sql relation.to_sql.sub(/SELECT.+FROM/,'SELECT COUNT(*) FROM')
|
56
|
+
count = relation.unscope(:select).select(:id).count
|
60
57
|
headers = {"Content-Type" => @config.media_type}
|
61
58
|
|
62
59
|
if count > 0
|
@@ -67,8 +67,7 @@ class Toast::PluralAssocRequest
|
|
67
67
|
# this fails if the where clause depends on the the extended select
|
68
68
|
# also remove any ORDER clauses
|
69
69
|
|
70
|
-
|
71
|
-
count = relation.count_by_sql relation.to_sql.sub(/SELECT.+FROM/,'SELECT COUNT(*) FROM').sub(/ORDER BY.*/,'')
|
70
|
+
count = relation.unscope(:select).select(:id).count
|
72
71
|
headers = {"Content-Type" => @config.media_type}
|
73
72
|
|
74
73
|
if count > 0
|
data/lib/toast/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- robokopp (Robert Annies)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|