Skip to content

Conversation

@evgenii
Copy link

@evgenii evgenii commented Jun 11, 2020

Hi guys. The example for building method is not working properly, it's build Document with nils

see example bellow or test case in branch:

[1] pry(main)>
[2] pry(main)>
[3] pry(main)> hash = {
[3] pry(main)*   data: [
[3] pry(main)*     {
[3] pry(main)*       id: 'a123',
[3] pry(main)*       type: 'user',
[3] pry(main)*       attributes: {
[3] pry(main)*         activated_at: '2020-06-11'
[3] pry(main)*       }
[3] pry(main)*     }
[3] pry(main)*   ]
[3] pry(main)* }
=> {:data=>[{:id=>"a123", :type=>"user", :attributes=>{:activated_at=>"2020-06-11"}}]}
[4] pry(main)> JSON::Api::Vanilla.build(hash)
=> #<JSON::Api::Vanilla::Document:0x00007f97e2adaaf8
 @container=#<Module:0x00007f97e2adae68>,
 @data=nil,
 @errors=nil,
 @keys={},
 @links={nil=>nil},
 @meta={nil=>nil},
 @objects={},
 @rel_links={},
 @superclass=#<Class:0x00007f97e2adadf0>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant