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

Fix State::configure alias and implementation #152

Merged
merged 2 commits into from Nov 29, 2012
Merged

Conversation

jvshahid
Copy link
Contributor

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.

@jvshahid
Copy link
Contributor Author

Ping, is there any update on this PR ?

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

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 added a commit to jvshahid/ruby-pg that referenced this pull request Feb 27, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants