base_ext.rb 569 B

123456789101112131415161718192021
  1. module ActiveResource
  2. class Base
  3. if ActiveResource::VERSION::MAJOR < 4
  4. # Backported from ActiveResource master branch
  5. def self.headers
  6. @headers ||= {}
  7. if superclass != Object && superclass.headers
  8. @headers = superclass.headers.merge(@headers)
  9. else
  10. @headers
  11. end
  12. end
  13. # https://github.com/rails/activeresource/commit/dfef85ce8f653f75673631b2950fcdb0781c313c
  14. def self.delete(id, options = {})
  15. connection.delete(element_path(id, options), headers)
  16. end
  17. end
  18. end
  19. end