Как научить ActiveSupport не переопределять стандартное поведение гема "json"?
require "rubygems"
gem "json"
require "json"
class Time
def to_json(options = nil)
"custom string"
end
end
hash = { :x => Time.now }
puts hash.to_json # => {"x":custom string}
gem "activesupport"
require "active_support/core_ext/object" # Somewhere into Rails internals
puts Time.now.to_json # => custom string
puts hash.to_json # => {"x":"2011-02-14T16:30:10+05:00"}
Ожидается: после запроса "active_support / core_ext / object" Я хочу получить результат {"x": пользовательская строка}.