jsonapi-resources 0.8.0.beta2 → 0.8.0.beta3

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
  SHA1:
3
- metadata.gz: 6619fb440bc0c0441a39af1623ba5b9b28ac7b86
4
- data.tar.gz: daa7f4b1e08fa81c03063269ea7637afa8375229
3
+ metadata.gz: a4b1520ce7f6d1b74c8b973ed7572e618a5b2d56
4
+ data.tar.gz: f1b2db023f75304968c0496c18034c989e58a043
5
5
  SHA512:
6
- metadata.gz: c3966400df28279c2bdc1c4af30f13003d119866e272667c5796b7cd32eb6f55eab26290169a918ff13e8579ec586863da6ebfa21aa2e97c4925c68a57df110f
7
- data.tar.gz: eaf11f0fa4bfe023d7bc75ce6441ace0112d6aa1f9281574dc74944c3b7525cf90ec96989510474fe4d6690966d1c046ed82af130e698f607de2f9ad84dbfaf6
6
+ metadata.gz: 9081c928a83cc37d2c944fc183171841072bd153d25cb901baf2c368a6d7d97e87016ac22f995231685046ab9edea4d098b55552222efae78cb2bbbe38dc08f8
7
+ data.tar.gz: 6d57fe3e8b70df7b82cf9095f0f5b15800d6f541d82533f9825b7df22de0aa201bed304861370745e80c4d11f725db4d0ecc529d99e3fb9f6fc29e49b32b81b7
@@ -141,6 +141,7 @@ module JSONAPI
141
141
  source_id = params[:source_id]
142
142
  relationship_type = params[:relationship_type]
143
143
  filters = params[:filters]
144
+ include_directives = params[:include_directives]
144
145
  sort_criteria = params[:sort_criteria]
145
146
  paginator = params[:paginator]
146
147
  fields = params[:fields]
@@ -149,7 +150,8 @@ module JSONAPI
149
150
 
150
151
  related_resources = source_resource.public_send(relationship_type,
151
152
  context: context,
152
- filters: filters,
153
+ filters: filters,
154
+ include_directives: include_directives,
153
155
  sort_criteria: sort_criteria,
154
156
  paginator: paginator,
155
157
  fields: fields)
@@ -129,7 +129,9 @@ module JSONAPI
129
129
  records = resource_klass.apply_filters(records, filters, options)
130
130
  end
131
131
 
132
- sort_criteria = options.fetch(:sort_criteria, {})
132
+ records = resource_klass.apply_includes(records, options)
133
+
134
+ sort_criteria = options.fetch(:sort_criteria, {})
133
135
  unless sort_criteria.nil? || sort_criteria.empty?
134
136
  order_options = relationship.resource_klass.construct_order_options(sort_criteria)
135
137
  records = resource_klass.apply_sort(records, order_options, @context)
@@ -348,7 +348,7 @@ module JSONAPI
348
348
  @included_objects[type] = {} unless @included_objects.key?(type)
349
349
 
350
350
  if already_serialized?(type, id)
351
- @included_objects[type][id][:object_hash].merge!(object_hash)
351
+ @included_objects[type][id][:object_hash].deep_merge!(object_hash)
352
352
  set_primary(type, id) if primary
353
353
  else
354
354
  @included_objects[type].store(id, primary: primary, object_hash: object_hash)
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.8.0.beta2'
3
+ VERSION = '0.8.0.beta3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta2
4
+ version: 0.8.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gebhardt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-10 00:00:00.000000000 Z
12
+ date: 2016-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler