jsonapi-resources 0.8.0.beta1 → 0.8.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jsonapi/acts_as_resource_controller.rb +6 -12
- data/lib/jsonapi/processor.rb +1 -0
- data/lib/jsonapi/resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6619fb440bc0c0441a39af1623ba5b9b28ac7b86
|
4
|
+
data.tar.gz: daa7f4b1e08fa81c03063269ea7637afa8375229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3966400df28279c2bdc1c4af30f13003d119866e272667c5796b7cd32eb6f55eab26290169a918ff13e8579ec586863da6ebfa21aa2e97c4925c68a57df110f
|
7
|
+
data.tar.gz: eaf11f0fa4bfe023d7bc75ce6441ace0112d6aa1f9281574dc74944c3b7525cf90ec96989510474fe4d6690966d1c046ed82af130e698f607de2f9ad84dbfaf6
|
data/README.md
CHANGED
@@ -1672,7 +1672,7 @@ not have a `format` set. You can do this by overriding the `default_attribute_op
|
|
1672
1672
|
resource for a system wide change).
|
1673
1673
|
|
1674
1674
|
```ruby
|
1675
|
-
def default_attribute_options
|
1675
|
+
def self.default_attribute_options
|
1676
1676
|
{format: :my_default}
|
1677
1677
|
end
|
1678
1678
|
```
|
@@ -126,26 +126,20 @@ module JSONAPI
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def ensure_valid_accept_media_type
|
129
|
-
|
129
|
+
unless valid_accept_media_type?
|
130
130
|
fail JSONAPI::Exceptions::NotAcceptableError.new(request.accept)
|
131
131
|
end
|
132
132
|
rescue => e
|
133
133
|
handle_exceptions(e)
|
134
134
|
end
|
135
135
|
|
136
|
-
def
|
136
|
+
def valid_accept_media_type?
|
137
137
|
media_types = media_types_for('Accept')
|
138
138
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
end
|
144
|
-
|
145
|
-
jsonapi_media_types.size.zero? ||
|
146
|
-
jsonapi_media_types.none? do |media_type|
|
147
|
-
media_type == JSONAPI::MEDIA_TYPE
|
148
|
-
end
|
139
|
+
media_types.blank? ||
|
140
|
+
media_types.any? do |media_type|
|
141
|
+
(media_type == JSONAPI::MEDIA_TYPE || media_type == ALL_MEDIA_TYPES)
|
142
|
+
end
|
149
143
|
end
|
150
144
|
|
151
145
|
def media_types_for(header)
|
data/lib/jsonapi/processor.rb
CHANGED
@@ -148,6 +148,7 @@ module JSONAPI
|
|
148
148
|
source_resource ||= source_klass.find_by_key(source_id, context: context, fields: fields)
|
149
149
|
|
150
150
|
related_resources = source_resource.public_send(relationship_type,
|
151
|
+
context: context,
|
151
152
|
filters: filters,
|
152
153
|
sort_criteria: sort_criteria,
|
153
154
|
paginator: paginator,
|
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.
|
4
|
+
version: 0.8.0.beta2
|
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-
|
12
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|