Module: ActiveSupport::ToJsonWithActiveSupportEncoder
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | activesupport/lib/active_support/core_ext/object/json.rb |
Instance Method Summary
Instance Method Details
#to_json(options = nil)
[ GitHub ]# File 'activesupport/lib/active_support/core_ext/object/json.rb', line 36
def to_json( = nil) if .is_a?(::JSON::State) # Called from JSON.{generate,dump}, forward it to JSON gem's to_json super( ) else # to_json is being invoked directly, use ActiveSupport's encoder ActiveSupport::JSON.encode(self, ) end end