# How to dynamically buid relationships between models?

**URL:** <https://www.ruby-forum.com/t/how-to-dynamically-buid-relationships-between-models/95100>\
**Category:** Engines\
**Created:** [May 22, 2006, 6:14am UTC](https://www.ruby-forum.com/t/how-to-dynamically-buid-relationships-between-models/95100 "2006-05-22T06:14:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![big\_mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@big\_mac](https://www.ruby-forum.com/u/big_mac)\
**Post date:** [May 22, 2006, 6:14am UTC](https://www.ruby-forum.com/t/how-to-dynamically-buid-relationships-between-models/95100/1 "2006-05-22T06:14:35Z")

</div>

Hi Joshua,  
This is what you’re looking for, it is under the README file of the  
engines  
plugin:

=== Model/Lib Tweaks  
Alas, tweaking model objects isn’t quite so easy (yet). If you need to  
change the behaviour of model objects, you’ll need to copy the model  
file  
from the engine into /app/models and edit the methods yourself.  
Library code can be overridden in a similar way.

So basically, you copy the user model file of the user engine over to  
your  
RAILS\_ROOT/app/models directory and add the relationship there.

When your application runs, it will pick up this version of the user  
model,  
instead of the UserEngine version.

Hope this helps,  
Mac

> Hi all

> I’m trapped with the following problem.

> I’d like to work with the UserEngine engine. Every user has let’s say a  
> Profile model. So they have a 1:1 relationship.

> Now I should declare this relationship in both models. But where do I  
> have to declare it exactly in the User model? I see they are working  
> somehow with modules in the engine’s lib dir, but how does this work  
> exactly? I’m quite confused… :-/
