Home Rails dev environment OpenStruct adds a top level table key
Reply: 0

Rails dev environment OpenStruct adds a top level table key

user626
1#
user626 Published in May 23, 2018, 10:46 pm

I have a strange issue where OpenStruct.new(url: 'test', token: 'test2') gives expected results in test environment, however, when I run the same code in development environment, the value becomes { "table": { "url": "test", "token": "test2" } }.

Ideally I'd like to use this as a Hash and not worry about it, but our codebase is using both struct.url and struct['url'] in multiple places and its not really feasible for me to change everything.

Any suggestions about how I can approach solving this?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305572 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO