rails/rails — pull request #4428 by dim (2012-01-12 18:13:11+00:00)
Title: Allow extending ActiveResource models by assigning custom connection

APIs aren't always easy, sometimes they want you to do something very special, something there is no hook in ActiveResource::Connection for. Extending connections isn't very slick at the moment, it requires you to overload `ActiveResource::Base.connection` in your models or some dirty patching.

The solution above allows users to assign a connection class in their models, allowing a new dimension of API customisations. I could also think of opportunities for new gems, with Connection classes that use other HTTP libraries, e.g. `activeresource-excon-connection`, etc. These would then be applicable on a model-by-model basis.

dim

PS: Original pull request - https://github.com/rails/rails/pull/4421