module Lighthouse
  class Base < ActiveResource::Base
    def self.inherited(base)
      Lighthouse.resources << base
      class << base        
        attr_accessor :site_format
        
        def site_with_update
          Lighthouse.update_site(self)
          site_without_update
        end
        alias_method_chain :site, :update
      end
      base.site_format = '%s'
      super
      Lighthouse.update_token_header(base)
      Lighthouse.update_auth(base)
    end
  end
end

module Lighthouse
  class Base < ActiveResource::Base
    self.format = :xml

    def self.inherited(base)
      Lighthouse.resources << base
      class << base        
        attr_accessor :site_format
        
        def site_with_update
          Lighthouse.update_site(self)
          site_without_update
        end
        alias_method_chain :site, :update
      end
      base.site_format = '%s'
      super
      Lighthouse.update_token_header(base)
      Lighthouse.update_auth(base)
    end
  end
end

Change default format to XML
Change default format to XML

The default format for ActiveResource objects was XML prior to 3.1,
but has since changed. Unfortunately, additional work would be needed
to correctly parse the JSON coming back from the API, as it includes
the root class name in the returned object. To simplify things, it's
best to continue using XML.
