See activesupport-2.3.8/lib/active_support/json/encoding.rb line 92 gRRRRRRRRRRRRRRRR!!!
Call UseJsonGemInRails.save_json_gem_to_json in your RAILS_ROOT/config/preinitializer.rb file.
Then set up an initializer and call UseJsonGemInRails.reload_json_gem_to_json in it.
class UseJsonGemInRailsclass << selfdef save_json_gem_to_jsonrequire 'json'classes.each do |klass|klass.class_eval doalias_method :to_json_from_gem, :to_jsonendendenddef reload_json_gem_to_json(classes + [ActiveSupport::JSON::Variable]).each do |klass|klass.class_eval doalias_method :to_json, :to_json_from_gemendendenddef classes[Object,Hash,Array,String,Numeric,Float,Integer,Regexp,]endendend
http://gist.github.com/461938
No comments:
Post a Comment