Skip to content
This repository was archived by the owner on Sep 30, 2018. It is now read-only.

Fix loading of nested attributes (Hashes) in REST adapter#15

Closed
svoboda-jan wants to merge 10 commits intoopal:masterfrom
svoboda-jan:fix_model_loading_from_nested_json
Closed

Fix loading of nested attributes (Hashes) in REST adapter#15
svoboda-jan wants to merge 10 commits intoopal:masterfrom
svoboda-jan:fix_model_loading_from_nested_json

Conversation

@svoboda-jan
Copy link
Copy Markdown
Contributor

This PR fixes loading of hashes from JSON. The previous way caused key-value attributes to be loaded as JS Object into opal, instead of Hash.

Also Model#from_form was updated to normalise hash keys and values:

'user[address]' => 'value'
#  becomes:
'user' => { 'address' => 'value' }

'user[]' => 'value'
# becomes:
'user' => [ 'value' ]

Another thing this PR fixes is Persistence#did_destroy, which weren't removing items from the RecordArray.

@svoboda-jan
Copy link
Copy Markdown
Contributor Author

@adambeynon 👍 This PR is ready, but not sure what is happening with the CI.

@svoboda-jan
Copy link
Copy Markdown
Contributor Author

@adambeynon Any update on this ? I have updated the PR and the CI seems ok now.

@svoboda-jan
Copy link
Copy Markdown
Contributor Author

@adambeynon Any thoughts on this ?

@svoboda-jan svoboda-jan reopened this Jun 13, 2014
@elia
Copy link
Copy Markdown
Member

elia commented Sep 29, 2018

I'm going to close all PRs before archiving the project, due to lack of maintainers

@elia elia closed this Sep 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants