# non-ActiveRecord model structure through api calls

**URL:** <https://www.ruby-forum.com/t/non-activerecord-model-structure-through-api-calls/143079>\
**Category:** Rails\
**Created:** [July 15, 2008, 1:00am UTC](https://www.ruby-forum.com/t/non-activerecord-model-structure-through-api-calls/143079 "2008-07-15T01:00:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [July 15, 2008, 1:00am UTC](https://www.ruby-forum.com/t/non-activerecord-model-structure-through-api-calls/143079/1 "2008-07-15T01:00:06Z")

</div>

This question is more about strategy than a how-to.

I have MyApplication which interfaces with ApplicationX through xml-rpc  
calls. In MyApplication I display information from ApplicationX. This  
information are from classes within ApplicationX.

Currently, I continue to go back and forth with the best way to approach  
this. Do I:

- replicate the information into MyApplication and deal with syncing  
issues. The pros I see with this route are easy validations,  
ActiveRecord associations, RESTful urls, etc…

or

- just make api calls whenever I need the information and deal with  
non-ActiveRecord models. The pros I see with this option is not having  
to continually sync the data with ApplicationX.

or

- Is there a way to do both? Create ActiveRecord models with an xml-rpc  
connection instead of MySQL connection. Is this possible?

I guess I’m wondering the best approach to take with the described  
senario. Any tips?

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [July 15, 2008, 10:03am UTC](https://www.ruby-forum.com/t/non-activerecord-model-structure-through-api-calls/143079/2 "2008-07-15T10:03:58Z")

</div>

On Jul 15, 12:00 am, Nate L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> issues. The pros I see with this route are easy validations,  
> ActiveRecord associations, RESTful urls, etc…
> 
> or
> 
> - just make api calls whenever I need the information and deal with  
> non-ActiveRecord models. The pros I see with this option is not having  
> to continually sync the data with ApplicationX.

Have you looked at ActiveResource ? (assuming you own application X  
and can change it)

Fred
