Allow extending ActiveResource models by assigning custom connection #4428

wants to merge 1 commit into


None yet
2 participants

dim commented Jan 12, 2012

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.


PS: Original pull request - #4421


arunagw commented Apr 19, 2012

Hey @dim

Closing this for now. As ActiveResource is moved here. you can open this PR on ActiveResource repo.

If you will not be able to do. Just let me know I can open a PR for the same.


arunagw closed this Apr 19, 2012

dim commented Apr 19, 2012

I won't be able to re-open this issue for the next few days at least, worried that I will forget. It's such a minor change and has soo many great and important implications. Could you please re-open it?

arunagw reopened this Apr 21, 2012


arunagw commented May 18, 2012

This PR cannot be merged into master as ActiveResource is moved. Please reopen this for 3-2-stable.

And for master open this here ActiveResource here

arunagw closed this May 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment