graphiti 1.3.7 → 1.3.8

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: cbf1dc5382739c7385f30c8edc31742239c10ccd62c2ab424ffede31f2dae7ea
4
- data.tar.gz: 5cba74c229d05543c276103b0500da935011ddf8ae34defd952e83d5870eb894
3
+ metadata.gz: 702baf7bca346f2b8d5cce4bc801191e2fa4ad39c67457c60c55d3617509878a
4
+ data.tar.gz: e9ac9fe8f507f14b3f443fb0c0870457a6296dc9ce97edce31d3183bf1714f2f
5
5
  SHA512:
6
- metadata.gz: d0bf531d0a71e736105e857e32e0fb97465113fcf174e3c69a26965e21d081c52dc81b0dd8cf887be3311f49a18a4ae4cbb5ef4515927fab32c9d346d59a35a1
7
- data.tar.gz: b71a81ffc7fa94667173d41fb388364b452d96f50a23ba410238a913463c10cc92d992c2a0586ee2ba6243aeed6cf63470c4cc0536043f05ffd42715e2c90947
6
+ metadata.gz: ab8370646228339af5859df4e67db45d7a6c4be5b8d635768bdfecb47961b12ec0c981c0493da8aa2cdcd7efb0d789565a70870f54ff997b7380f2a72dfb65e9
7
+ data.tar.gz: f7670b3d725bae965036838aeb1437ccecb171deb5c407a697df2dedd0ffc7d6bc69e3c6af7b4584401dfa9737a2d907447326617cd12cb2eda3a161b3ff502a
@@ -68,7 +68,7 @@ module Graphiti
68
68
  model_ref = model
69
69
  has_many name, opts do
70
70
  params do |hash|
71
- hash[:filter][:"#{as}_type"] = model_ref.name
71
+ hash[:filter][:"#{as}_type"] = { eql: model_ref.name }
72
72
  end
73
73
 
74
74
  instance_eval(&blk) if blk
@@ -82,7 +82,7 @@ module Graphiti
82
82
  model_ref = model
83
83
  has_one name, opts do
84
84
  params do |hash|
85
- hash[:filter][:"#{as}_type"] = model_ref.name
85
+ hash[:filter][:"#{as}_type"] = { eql: model_ref.name }
86
86
  end
87
87
 
88
88
  instance_eval(&blk) if blk
@@ -85,9 +85,13 @@ module Graphiti
85
85
 
86
86
  def stats
87
87
  @stats ||= if @query.hash[:stats]
88
+ scope = @scope.unpaginated_object
89
+ if (group = @query.hash[:stats].delete(:group_by))
90
+ scope = scope.group(group[0])
91
+ end
88
92
  payload = Stats::Payload.new @resource,
89
93
  @query,
90
- @scope.unpaginated_object,
94
+ scope,
91
95
  data
92
96
  payload.generate
93
97
  else
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.3.7"
2
+ VERSION = "1.3.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-25 00:00:00.000000000 Z
11
+ date: 2022-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable