jsonapi-materializer 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88cac5be67d5c5dda8a916b3acfea19f26c2c45ca6c3d5607b9fd61266df48e9
4
- data.tar.gz: 943e3e1514ba0e6755f477b2ea078b16943131548e51b0764b7592dace815570
3
+ metadata.gz: a2f61a86bda571eb041aa543a16338d80c82b742708f90be0c321e45f27eb97e
4
+ data.tar.gz: fb22fbb7a3998c2ca6563c85a65b12980fae019feb96972523850c8074160485
5
5
  SHA512:
6
- metadata.gz: 15fc3d7edec734219328b0ac196d4d2ac2fcae51b0ffa398b1e87bf5626ec248882a0b022ccb6228fcac50e5da639a0747838d3ca538184c3a87905160abde1b
7
- data.tar.gz: e94e167e03eb5aebb129ed1508442af0ec64ca01858cc7cc9a5d10545d94eba7d5fdcfa31b73d89aaa10aa01324ede6e5aa0e3a4066f7b15bcf4b28d8d0a5e8c
6
+ metadata.gz: 1a27fc6d325e69296ae5ce9e73a21caf13194eba084b71f127a81574c63fe839cba0be3701b2be43f812efa7e9d22428f20891d46703eb30fe7d2cba73d2f3b8
7
+ data.tar.gz: 7c661026d63ac185e4f7d01db31b83547945d3903c14775273dbe06b05455a57209286efc5237c764b26853c3a8bfe733c4064aa3b081e1fd38e287a675a36c3
data/README.md CHANGED
@@ -26,7 +26,7 @@ class AccountsController < ApplicationController
26
26
 
27
27
  def show
28
28
  render(
29
- :json => AccountMaterializer::Resource.new(:object => object)
29
+ :json => AccountMaterializer.new(:object => object)
30
30
  )
31
31
  end
32
32
  end
@@ -22,13 +22,17 @@ module JSONAPI
22
22
 
23
23
  def as_json(*)
24
24
  {
25
- links: {
26
- first: (links_pagination.expand(offset: 1, limit: limit_value).to_s unless total_pages.zero? || first_page?),
27
- prev: (links_pagination.expand(offset: prev_page, limit: limit_value).to_s unless total_pages.zero? || first_page?),
28
- self: (links_self unless total_pages.zero?),
29
- next: (links_pagination.expand(offset: next_page, limit: limit_value).to_s unless total_pages.zero? || last_page?),
30
- last: (links_pagination.expand(offset: total_pages, limit: limit_value).to_s unless total_pages.zero? || last_page?)
31
- }.compact,
25
+ links: if pagination
26
+ {
27
+ first: (links_pagination.expand(offset: 1, limit: limit_value).to_s unless total_pages.zero? || first_page?),
28
+ prev: (links_pagination.expand(offset: prev_page, limit: limit_value).to_s unless total_pages.zero? || first_page?),
29
+ self: (links_self unless total_pages.zero?),
30
+ next: (links_pagination.expand(offset: next_page, limit: limit_value).to_s unless total_pages.zero? || last_page?),
31
+ last: (links_pagination.expand(offset: total_pages, limit: limit_value).to_s unless total_pages.zero? || last_page?)
32
+ }.compact
33
+ else
34
+ {}
35
+ end,
32
36
  data: resources,
33
37
  included:
34
38
  }.transform_values(&:presence).compact
@@ -2,6 +2,6 @@
2
2
 
3
3
  module JSONAPI
4
4
  module Materializer
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-materializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurtis Rainbolt-Greene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -81,7 +81,7 @@ files:
81
81
  - lib/jsonapi/materializer/resource_spec.rb
82
82
  - lib/jsonapi/materializer/version.rb
83
83
  - lib/jsonapi/materializer_spec.rb
84
- homepage: http://krainboltgreene.github.io/jsonapi-materializer.rb
84
+ homepage: https://github.com/krainboltgreene/jsonapi-materializer.rb
85
85
  licenses:
86
86
  - HL3
87
87
  metadata: