jsonapi-serializers 0.16.0 → 0.16.1

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: 0a63fa6a767f6236335d147e099ca81b13e24d72
4
- data.tar.gz: e8fe7e954d1b5a14d2903ff0d72923eb24d0abb8
3
+ metadata.gz: 7f9584848d438371a8e74a93af4cd1e2ef0dbe2f
4
+ data.tar.gz: 997e23a37237cd66ef6eaa5776c0512041178be3
5
5
  SHA512:
6
- metadata.gz: 64417e501b68bb8e686eb362e8ea53c65afff161d5c9f0f881e08d15436c8f4b27fd06491ee5d479d74c99ce7ed5c78e72e001a82a18a019d56cbd7b99ef28e9
7
- data.tar.gz: da8f7e8f9c78c18f5d6f6a2ae7b1399116a7876f40c0c71b4d59d36615be5ba88e7b5c978b3f536dbd61e071ea6fd103940044a3b3a3d89d08a66649f113ddf1
6
+ metadata.gz: ac2d3b371c2c94bdbacd2d77f2fb63d3b9e0b5f5e29daca35bffaf8152a2dbc3c8b68081c2eb3c4981ebb79f7af5c85f119b769cf68028d17de3f71d57515854
7
+ data.tar.gz: 3a5789b22a8508cd3ee6641fe2753490321087592852f670a7824ed59d6f3a67b6d6a2b3ed4d1a0d55380bf3948a3b0b9cb4ea502d18972a2aee522d7f39ceb2
data/README.md CHANGED
@@ -244,7 +244,7 @@ end
244
244
  ```
245
245
  ```ruby
246
246
  def relationship_self_link(attribute_name)
247
- "#{self_link}/links/#{format_name(attribute_name)}"
247
+ "#{self_link}/relationships/#{format_name(attribute_name)}"
248
248
  end
249
249
  ```
250
250
  ```ruby
@@ -205,10 +205,11 @@ module JSONAPI
205
205
  # Allow "if: :show_title?" and "unless: :hide_title?" attribute options.
206
206
  if_method_name = attr_data[:options][:if]
207
207
  unless_method_name = attr_data[:options][:unless]
208
+ formatted_attribute_name = format_name(attribute_name).to_sym
208
209
  show_attr = true
209
210
  show_attr &&= send(if_method_name) if if_method_name
210
211
  show_attr &&= !send(unless_method_name) if unless_method_name
211
- show_attr &&= @_fields[type.to_s].include?(attribute_name) if @_fields[type.to_s]
212
+ show_attr &&= @_fields[type.to_s].include?(formatted_attribute_name) if @_fields[type.to_s]
212
213
  show_attr
213
214
  end
214
215
  protected :should_include_attr?
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Serializer
3
- VERSION = '0.16.0'
3
+ VERSION = '0.16.1'
4
4
  end
5
5
  end
@@ -886,7 +886,7 @@ describe JSONAPI::Serializer do
886
886
  long_comments = [first_comment, second_comment]
887
887
  post = create(:post, :with_author, long_comments: long_comments)
888
888
 
889
- fields = {posts: 'title,author,long_comments'}
889
+ fields = {posts: 'title,author,long-comments'}
890
890
  serialized_data = JSONAPI::Serializer.serialize(post, fields: fields)
891
891
  expect(serialized_data['data']['relationships']).to eq ({
892
892
  'author' => {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Fotinakis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-17 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.8
140
+ rubygems_version: 2.6.7
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Pure Ruby readonly serializers for the JSON:API spec.