ruby-changes:17995
From: naruse <ko1@a...>
Date: Thu, 2 Dec 2010 13:41:20 +0900 (JST)
Subject: [ruby-changes:17995] Ruby:r30016 (trunk): Setup Symbol#to_json to avoid conflict.
naruse 2010-12-02 13:36:54 +0900 (Thu, 02 Dec 2010) New Revision: 30016 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30016 Log: Setup Symbol#to_json to avoid conflict. Modified files: trunk/test/json/test_json_rails.rb Index: test/json/test_json_rails.rb =================================================================== --- test/json/test_json_rails.rb (revision 30015) +++ test/json/test_json_rails.rb (revision 30016) @@ -13,6 +13,14 @@ class TC_JSONRails < Test::Unit::TestCase include JSON + def setup + Symbol.class_eval do + def to_json(*a) + to_s.to_json(*a) + end + end + end + class A def initialize(a) @a = a -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/