# File lib/active_model/serializers/json.rb, line 82 def encode_json(encoder) hash = serializable_hash(encoder.options) if include_root_in_json custom_root = encoder.options && encoder.options[:root] hash = { custom_root || self.class.model_name.element => hash } end ActiveSupport::JSON.encode(hash) end