synewaves / rubillow

Ruby library to access the Zillow API
MIT License
50 stars 39 forks source link

Verify Region Data Exists #4

Closed awmichel closed 11 years ago

awmichel commented 11 years ago

In some rare cases the region data for a property is empty and would cause the rubillow to throw a missing method error when attempting to read the region attributes. This fix verifies the region data exists before attempting to write it to the model.

synewaves commented 11 years ago

@awmichel Can you include a test case for this change?

synewaves commented 11 years ago

@awmichel Also, can you submit a new commit without the whitespace changes?

awmichel commented 11 years ago

@synewaves Added a test case for the missing region data and updated the commits to not include the whitespace changes.

Should there be any additional helper for checking the region information on a result? Something like a has_region? method? I considered this, but it's also easy enough to simply check if region or local_real_estate are nil.

synewaves commented 11 years ago

This looks great. I don't know if we need to add the has_region? helper, since like you said, nil checks are pretty simple to do. If that will work, I''ll close this and merge it in.

awmichel commented 11 years ago

Fine by me, go ahead and merge.