graphiti 1.2.18 → 1.2.19

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: f286647b00c9b97ec5c280e48e4758f31fbee7f00e19d22073b95c8f10956ad6
4
- data.tar.gz: bf208a2b4971f7603bf287c2cfe4787b36525a8b6612e62a99b3bacd7cd80b45
3
+ metadata.gz: cd17ed21a3a7d08e6a1cf0ee76827f1d539091f08234adf596fe9287089305c6
4
+ data.tar.gz: ee470506b0ccb4d5dc6e0a132021eb2f22e8b6de60e12733922a9a1ca51d0617
5
5
  SHA512:
6
- metadata.gz: 1af7ee296afbe6cf900ceb6e3c7fd4e05fd8b0df81d91b748d2b970fdf77245298e755c024c150cde26e86636c3814a20ab45934b810af8ed501b2ec43449549
7
- data.tar.gz: f51c1183ede1fd0e4e5aa91ec145b3cd1bc5f7e4633cd61e59232fc6575cb39ca85240fa8590d5b264b29b0522352888b6a7c684cd48a7f4e46b5e47a692155e
6
+ metadata.gz: '058c85a01c7eeb6bf9318500d0b77d143d1b259872e5f98b8470dcce8ca5e5a31d3e4213e032e9c512dec4b00522a4c2030e851e2f0e2f41b23e900876b4c575'
7
+ data.tar.gz: 7680fe2ffca53e9d8c2ab9ac35ca5ad5c2eb1f4ae2417dc8e233f847ca4e36fad5ec383ed6971c0e325f7a4daa6cb6feffaf19971d1fbebd0437d0585ec24e32
@@ -44,16 +44,19 @@ module Graphiti
44
44
 
45
45
  def hash
46
46
  @hash ||= {}.tap do |h|
47
- h[:filter] = filters unless filters.empty?
48
- h[:sort] = sorts unless sorts.empty?
49
- h[:page] = pagination unless pagination.empty?
50
- unless association?
51
- h[:fields] = fields unless fields.empty?
52
- h[:extra_fields] = extra_fields unless extra_fields.empty?
47
+ h[:filter] = filters
48
+ h[:sort] = sorts
49
+ h[:page] = pagination
50
+ if association?
51
+ resource_type = @resource.class.type
52
+ h[:extra_fields] = {resource_type => extra_fields[resource_type]} if extra_fields.key?(resource_type)
53
+ else
54
+ h[:fields] = fields
55
+ h[:extra_fields] = extra_fields
53
56
  end
54
- h[:stats] = stats unless stats.empty?
55
- h[:include] = sideload_hash unless sideload_hash.empty?
56
- end
57
+ h[:stats] = stats
58
+ h[:include] = sideload_hash
59
+ end.reject { |_, value| value.empty? }
57
60
  end
58
61
 
59
62
  def zero_results?
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.2.18"
2
+ VERSION = "1.2.19"
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.2.18
4
+ version: 1.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond