def as_json(options = nil) #:nodoc:
            # use encoder as a proxy to call as_json on all elements, to protect from circular references
            encoder = options && options[:encoder] || ActiveSupport::JSON::Encoding::Encoder.new(options)
            map { |v| encoder.as_json(v) }
        end
def as_json(options = nil) #:nodoc:
            # use encoder as a proxy to call as_json on all elements, to protect from circular references
            encoder = options && options[:encoder] || ActiveSupport::JSON::Encoding::Encoder.new(options)
            map { |v| encoder.as_json(v) }
        end
A couple json serialization methods copied from active_support