evolve75/RubyTree — pull request #4 by escline (2012-03-19 00:48:11+00:00)
Title: Implemented as_json method, since Rails JSON encoding is done through as...

..._json.

I was getting an error when trying to use RubyTree in Rails 3. I finally found this answer on StackOverflow: http://stackoverflow.com/a/6880638/273808

I created an as_json method and moved Dirk's to_json logic into it, and made the return result a hash. The to_json method was then changed to use the new as_json method.

I tested this in Ruby 1.8.7 and Ruby 1.9.2 using only RubyTree and JSON gems, and Rails 2.3.14 and Rails 3.2.2 using ActiveSupport's JSON encoding.