# Remote ActiveRecord relation (over network)

**URL:** <https://www.ruby-forum.com/t/remote-activerecord-relation-over-network/189043>\
**Category:** Rails\
**Created:** [May 23, 2010, 12:28am UTC](https://www.ruby-forum.com/t/remote-activerecord-relation-over-network/189043 "2010-05-23T00:28:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![judge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de0a6/32.png) [@judge](https://www.ruby-forum.com/u/judge)\
**Post date:** [May 23, 2010, 12:28am UTC](https://www.ruby-forum.com/t/remote-activerecord-relation-over-network/189043/1 "2010-05-23T00:28:57Z")

</div>

Hi,

I have a has and belongs to many relation between User and Article  
models, and I would like to link them even if an article if not hosted  
on the same database then a user.

For example, If an article exists at [http://foo.com/articles/3](http://foo.com/articles/3) and a  
user exists at [http://bar.com/users/1](http://bar.com/users/1), If would like to be able to do  
from [http://foo.com](http://foo.com) web interface or [http://bar.com](http://bar.com) web interface this  
kind of query: a\_user.articles (or an\_article.users).

I think this can be possible adding a field like “url” in users and  
articles tables. But I don’t know how to process for ActiveRecord. My  
Article model looks like this:

class Article \< ActiveRecord::Base  
has\_and\_belongs\_to\_many :users  
end

Is there yet some example of project using this kind of relation over  
internet?

Many thanks
