Zerigo DNS gem与ActiveResource 3.1不兼容

时间:2011-08-24 20:04:51

标签: ruby-on-rails xml json format activeresource

我正在使用zerigo_dns 1.2.0 gem(https://github.com/twilson63/zerigo_dns),它需要使用ActiveResource进行“请求”调用。它与Rails 3.0.4一起工作正常,因为默认格式是XML。但Rails 3.1.0.rc4使用JSON作为默认值并导致问题,因为Zerigo期待application / xml mime-type。

任何人都知道如何切换为有效使用XML作为默认格式?

2 个答案:

答案 0 :(得分:1)

Zerigo :: DNS :: Base继承自ActiveResource。你应该能够做到

Zerigo::DNS::Base.format = :xml

答案 1 :(得分:0)

使用这个猴子补丁:

class Zerigo::DNS::Base
 def self.format
  self._format || ActiveResource::Formats::XmlFormat
 end
end