Skip to content

Instantly share code, notes, and snippets.

@kamal
Created September 15, 2009 08:31
Show Gist options
  • Save kamal/187182 to your computer and use it in GitHub Desktop.
Save kamal/187182 to your computer and use it in GitHub Desktop.
module ActiveResource
class Base
def to_xml_with_methods(options)
methods = Array(options.delete(:methods))
methods.each do |m|
attributes[m] = send(m)
end
to_xml_without_methods(options)
end
alias_method_chain :to_xml, :methods
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment