jsonapi-materializer 1.0.0.rc4 → 1.0.0.rc5

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: 0757d7c81ae43865fa36c9f7c871dedbcabe9c032bb152e019d70506a697270a
4
- data.tar.gz: 3f4d99ccfa4511dd874e081aec2092647c8b4e1b529964ff693ab1eb7f5fc5d5
3
+ metadata.gz: 45e2b33985d2730ab66005e7e0189c6106cd390098f15bc896a972f6c1d6355a
4
+ data.tar.gz: e1cba7ed4b60dafe3979b6e7d6317311e5a65d0b0b202947d00c0b01bc0ccc13
5
5
  SHA512:
6
- metadata.gz: ab84f5d732b41dba80efcdfe437b6652bac1450652fae461a7ac74494a049e4c6ad454f4b94cb530dc8d94129d8b9a91933f636e735949dbf84840eb34cd8858
7
- data.tar.gz: bdcb3fd9920da53619772d514991bc10377ddf8685739488c3e391809312768ee8035632faa4a2f42a08dd1dd0c2090358f50b284880e0ec975bec0f87791a43
6
+ metadata.gz: ee08a498093076a0125b46a08001ca82034f7deddd2654837885e896d74eddee6a6bd2a7a863dae16b5a589796c5c8b39d512d86cf2bdcb5c68f32a6496d91c6
7
+ data.tar.gz: 2250215080f11923be9f50bd67276b221a957437a0b8ac75b17360fd7be2935488167f11ab2ddecee7f505a3fb207587da55902cf537c40bc5f4de4ad64088b8
@@ -2,7 +2,7 @@ require("spec_helper")
2
2
 
3
3
  RSpec.describe(JSONAPI::Materializer::Collection) do
4
4
  let(:described_class) {ArticleMaterializer::Collection}
5
- let(:policy) {Class.new { def read_attribute?(name); true end}}
5
+ let(:policy) {Class.new { def read_attribute?(type, name); true end}}
6
6
  let(:collection) {described_class.new(:object => object, :includes => [["comments"], ["author"]], :context => {:policy => policy.new})}
7
7
 
8
8
  describe("#as_json") do
@@ -26,8 +26,8 @@ module JSONAPI
26
26
 
27
27
  def visible?(subject)
28
28
  return visible if [true, false].include?(visible)
29
- return subject.send(visible, self) if visible.is_a?(Symbol)
30
- return visible.call(self) if visible.respond_to?(:call)
29
+ return subject.send(visible, :attribute, self) if visible.is_a?(Symbol)
30
+ return visible.call(:attribute, self) if visible.respond_to?(:call)
31
31
 
32
32
  true
33
33
  end
@@ -48,8 +48,8 @@ module JSONAPI
48
48
 
49
49
  def visible?(subject)
50
50
  return visible if [true, false].include?(visible)
51
- return subject.send(visible, self) if visible.is_a?(Symbol)
52
- return visible.call(self) if visible.respond_to?(:call)
51
+ return subject.send(visible, type, self) if visible.is_a?(Symbol)
52
+ return visible.call(type, self) if visible.respond_to?(:call)
53
53
 
54
54
  true
55
55
  end
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Materializer
3
- VERSION = "1.0.0.rc4".freeze
3
+ VERSION = "1.0.0.rc5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-materializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc4
4
+ version: 1.0.0.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurtis Rainbolt-Greene