graphiti 1.3.8 → 1.3.9

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: 702baf7bca346f2b8d5cce4bc801191e2fa4ad39c67457c60c55d3617509878a
4
- data.tar.gz: e9ac9fe8f507f14b3f443fb0c0870457a6296dc9ce97edce31d3183bf1714f2f
3
+ metadata.gz: 30f5b9382256603c1f3f8f4ab8c4e614804c1a2e2152617d7b19892bca6bd465
4
+ data.tar.gz: 948837bfa0f8deee2f44849aba9df2bb18f2fdf532a1caaab92b16c7d9ba91fd
5
5
  SHA512:
6
- metadata.gz: ab8370646228339af5859df4e67db45d7a6c4be5b8d635768bdfecb47961b12ec0c981c0493da8aa2cdcd7efb0d789565a70870f54ff997b7380f2a72dfb65e9
7
- data.tar.gz: f7670b3d725bae965036838aeb1437ccecb171deb5c407a697df2dedd0ffc7d6bc69e3c6af7b4584401dfa9737a2d907447326617cd12cb2eda3a161b3ff502a
6
+ metadata.gz: 4fe6fff9c219fd463378bbdc793f648cbeffe27c61c191f11e2aab4723e952d2d8f7cc26b334255e12adca3e9d819b1bbde17697a6621f11a28151d2649d6d9c
7
+ data.tar.gz: becca9eaa17f328a99669e1e855a4024862b45d1902ddf30de597f7b33e3f52e4145b0f1dba1542a0d144ba2bc1bdec280ad9d8fa599a102ead9efb5260e1ab3
@@ -415,6 +415,10 @@ module Graphiti
415
415
  [:eq, :not_eq, :gt, :gte, :lt, :lte].freeze
416
416
  end
417
417
 
418
+ def can_group?
419
+ false
420
+ end
421
+
418
422
  private
419
423
 
420
424
  def activerecord_adapter
@@ -305,6 +305,14 @@ module Graphiti
305
305
  ::ActiveRecord::Base.clear_active_connections!
306
306
  end
307
307
 
308
+ def can_group?
309
+ true
310
+ end
311
+
312
+ def group(scope, attribute)
313
+ scope.group(attribute)
314
+ end
315
+
308
316
  private
309
317
 
310
318
  def column_for(scope, name)
@@ -86,8 +86,10 @@ module Graphiti
86
86
  def stats
87
87
  @stats ||= if @query.hash[:stats]
88
88
  scope = @scope.unpaginated_object
89
- if (group = @query.hash[:stats].delete(:group_by))
90
- scope = scope.group(group[0])
89
+ if resource.adapter.can_group?
90
+ if (group = @query.hash[:stats].delete(:group_by))
91
+ scope = resource.adapter.group(scope, group[0])
92
+ end
91
93
  end
92
94
  payload = Stats::Payload.new @resource,
93
95
  @query,
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.3.8"
2
+ VERSION = "1.3.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond