toast 1.0.10 → 1.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d09770e50b4e4d4ce2eb289c409fadbd59f3249
4
- data.tar.gz: b4678e46f18af2c40ff2b928ed0c1589a5d2703c
3
+ metadata.gz: b91449bc966996f84da87e01c7788088fb429ef4
4
+ data.tar.gz: b0986f54a342b73fb228aae8cd5b2ceb27e5e322
5
5
  SHA512:
6
- metadata.gz: ab20c2cfdbffda2140b77da1d9de9609466817fdeccc0a71faea31a4f07b056cf228d830c3cd4d5618aa9c6a7838ec71f3d1e0e1b95b52ed6b7f785ba2346df5
7
- data.tar.gz: 2d0651c71b2cd2f055f54a894e082bad47e124247862327207a7006d80287e57ed55f807a1fbf12a88e4bbc608dcbc8b4ab78aa7d9f8dc0303a2a798e80cdad7
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
- count = relation.count_by_sql relation.to_sql.sub(/SELECT.+FROM/,'SELECT COUNT(*) FROM')
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
@@ -1,3 +1,3 @@
1
1
  module Toast
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
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.10
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-03-05 00:00:00.000000000 Z
11
+ date: 2019-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails