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

Already on GitHub? Sign in to your account

Fix State::configure alias and implementation #152

Merged
merged 2 commits into from Nov 29, 2012

Conversation

Projects
None yet
3 participants
Contributor

jvshahid commented Nov 23, 2012

I found out this error while I was investigating errors while running the active record test suite under JRuby. The error is:

NoMethodError: undefined method `merge' for #<JSON::Ext::Generator::State:0x53c20385>
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/json/encoding.rb:67:in `options_for'
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/json/encoding.rb:50:in `encode'
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/json/encoding.rb:82:in `check_for_circular_references'
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/json/encoding.rb:49:in `encode'
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/json/encoding.rb:34:in `encode'
    from /home/jvshahid/codez/jruby-pg/tmp_rails/activesupport/lib/active_support/core_ext/object/to_json.rb:16:in `to_json'
    from json/ext/GeneratorState.java:210:in `generate

It turns out that the configure method wasn't aliased properly in the Java version and when I tried to run the new test under MRI I found out that the configuration strings aren't stored with the null character so I fixed that as well.

This patch includes a test that covers both merge and configure as well as a fix for both implementations to make the test pass.

Contributor

jvshahid commented Nov 28, 2012

Ping, is there any update on this PR ?

@flori flori merged commit bdb8e00 into flori:master Nov 29, 2012

1 check passed

default The Travis build passed
Details

It's strange, but even with the merge alias added, I'm still having the same issue. I've tested against both JSON 1.7.6 and JSON-master.

https://gist.github.com/4632270

@jvshahid jvshahid added a commit to jvshahid/ruby-pg that referenced this pull request Feb 27, 2015

@jvshahid jvshahid use my clone of the json gem since a big number of tests are failing …
…because of a bug in 1.7.5, see flori/json#152.
a4c1613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment