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

Comments

Bug fix and improvement to handling of :relationships in to_json method#22

Open
BinaryPaean wants to merge 4 commits intodatamapper:masterfrom
BinaryPaean:master
Open

Bug fix and improvement to handling of :relationships in to_json method#22
BinaryPaean wants to merge 4 commits intodatamapper:masterfrom
BinaryPaean:master

Conversation

@BinaryPaean
Copy link

Currently no check for nil option hash with :relationships opt in to_json, so something like:
cow.to_json({:relationships => {:baby_cows => {}}}) is required.
Null check and test added, along with collection of string/symbol arguments to make
cow.to_json(:relationships => :baby_cows) possible, along with cow.to_json(:relationships => [:baby_cows])

@BinaryPaean
Copy link
Author

Commits are fix,test,fix,test sequence for convenience. First pair just allow for a null opts in the chained call. Second pair allow for symbol or string arguments.

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.

1 participant