toast 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toast/plural_assoc_request.rb +4 -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: b91449bc966996f84da87e01c7788088fb429ef4
|
4
|
+
data.tar.gz: b0986f54a342b73fb228aae8cd5b2ceb27e5e322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5754881ff246d16513363a307f36b3a65a4dddbc46dae44083fc245d240dbaaf2ffa28ef2cfeb15686946272a062e5e0627b8d7f961ad4583ead50211fb207
|
7
|
+
data.tar.gz: 1b59e4a0a096db8bf621eb3448651322de390c9fe25746d8ee397cff1312ac6f127c7ab06cdf06099c391db411e4c91985501f747b97b84c57c0f82353cf2eea
|
@@ -60,11 +60,13 @@ class Toast::PluralAssocRequest
|
|
60
60
|
|
61
61
|
call_allow(@config.via_get.permissions, @auth, source, @uri_params) # may raise NotAllowed, AllowError
|
62
62
|
|
63
|
-
|
64
63
|
# count = relation.count doesn't always work
|
65
64
|
# fix problematic select extensions for counting (-> { select(...) })
|
66
65
|
# this fails if the where clause depends on the the extended select
|
67
|
-
|
66
|
+
# also remove any ORDER clauses
|
67
|
+
|
68
|
+
# How can we do this with the ActiveRecord API in a cleaner way?
|
69
|
+
count = relation.count_by_sql relation.to_sql.sub(/SELECT.+FROM/,'SELECT COUNT(*) FROM').sub(/ORDER BY.*/,'')
|
68
70
|
headers = {"Content-Type" => @config.media_type}
|
69
71
|
|
70
72
|
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.0.
|
4
|
+
version: 1.0.11
|
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-
|
11
|
+
date: 2019-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|