Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location.human_address is String -- not Hashie::Mash #14

Open
marks opened this issue Sep 9, 2014 · 4 comments
Open

location.human_address is String -- not Hashie::Mash #14

marks opened this issue Sep 9, 2014 · 4 comments

Comments

@marks
Copy link

marks commented Sep 9, 2014

Is this on purpose or would a PR to convert location fields' human_address in to hashes be accepted?

Right now, we are looping through all returned records to convert the location into a hash like so:

 @results = @results.map do |result|
   result.location_1.human_address = JSON.parse(result.location_1.human_address)
   result
 end
@chrismetcalf
Copy link
Contributor

@marks I love this idea. I've already been thinking about adding some "demarshalling" functionality to the Ruby gem, to do things like convert timestamps into Time objects, decode numerics, etc.

One thing to be concerned about will be backwards compatibility. Thoughts?

@marks
Copy link
Author

marks commented Sep 10, 2014

@chrismetcalf - didnt even realize dates were Strings - yes, we need demarshalling. How do you feel about tackling backwards compatibility by having it as an opt-in feature only by defining a config variable?

@chrismetcalf
Copy link
Contributor

I’m all for making it controlled by a config variable. If you’ve got the time to take this on, I’ll gladly give feedback and accept your PR! 

It might be worth checking out the datatype reference too: http://dev.socrata.com/docs/datatypes/

On Tue, Sep 9, 2014 at 5:19 PM, Mark Silverberg notifications@github.com
wrote:

@chrismetcalf - didnt even realize dates were Strings - yes, we need demarshalling. How do you feel about tackling backwards compatibility by having it as an opt-in feature only by defining a config variable?

Reply to this email directly or view it on GitHub:
#14 (comment)

marks added a commit to marks/soda-ruby that referenced this issue Sep 10, 2014
@marks
Copy link
Author

marks commented Sep 10, 2014

Just to keep everyone updated, I am trying to see if this makes more sense to build into Hashie which soda-ruby uses: hashie/hashie#227

@marks marks closed this as completed Sep 10, 2014
@marks marks reopened this Sep 10, 2014
marks added a commit to marks/soda-ruby that referenced this issue Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants