Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / spec / dummy / config / initializers / activeresource.rb
Size: Mime:
module ActiveResource
  class Base
    self.include_root_in_json = true

    # Open up ARes to force include_root_in_json to be ignored
    def as_json(options = nil)
      root = if options && options.key?(:root)
        options[:root]
      else
        false
      end

      if root
        { root => serializable_hash(options) }
      else
        serializable_hash(options)
      end
    end
  end

  # Maybe we need this in the future
  # module Formats
  #   module JsonFormat
  #     def decode(json)
  #       ActiveSupport::JSON.decode(json)
  #     end
  #   end
  # end
end