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

wants to merge 4 commits into

1 participant


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])


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 join this conversation on GitHub. Already have an account? Sign in to comment