ylecuyer / survey-gizmo-ruby

Gem to use the Survey Gizmo API
MIT License
23 stars 26 forks source link

Handling resources that do not return data node #98

Closed nathancolgate closed 4 years ago

nathancolgate commented 7 years ago

Not all resources return a data node (i.e. Contacts).

I was trying to create contacts for a campaign and was getting a "Expected nil to respond to #to_hash" from Virtus' /virtus-1.0.5/lib/virtus/attribute_set.rb#197

The issue is that SurveyGizmo only returns {"result_ok"=>true, "id"=>100112272} for new Contacts.

So this pull request forces nil to hash so that virtus doesn't choke.

jarthod commented 7 years ago

Looks good but could you please add a spec for this case?

apurvis commented 7 years ago

it's this issue, no? https://github.com/jarthod/survey-gizmo-ruby/issues/81

apurvis commented 7 years ago

@nathancolgate i also agree that a spec is necessary.

apurvis commented 7 years ago

damn @nathancolgate feel free to tackle https://github.com/jarthod/survey-gizmo-ruby/pull/70 while you're looking at this

apurvis commented 7 years ago

(both this, https://github.com/jarthod/survey-gizmo-ruby/issues/81, and https://github.com/jarthod/survey-gizmo-ruby/pull/70 are all about the Contact class, which is something i never use and i'm not sure any of the other maintainers do either - hence all these edge case issues)

apurvis commented 7 years ago

@nathancolgate any plans to add that spec?

nathancolgate commented 7 years ago

@apurvis not right now, I'm afraid. But I know this project will resurface at the end of the year and I may have time to add it then.

nathancolgate commented 5 years ago

Sad times. The project that was using this gem just got shuttered on our end. I'm afraid I can't dedicate any time or resources to it anymore.