# Extending model in plugin from another plugin

**URL:** <https://www.ruby-forum.com/t/extending-model-in-plugin-from-another-plugin/93036>\
**Category:** Rails\
**Created:** [April 26, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/extending-model-in-plugin-from-another-plugin/93036 "2007-04-26T20:08:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/aeb1de/32.png) [@felix](https://www.ruby-forum.com/u/felix)\
**Post date:** [April 26, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/extending-model-in-plugin-from-another-plugin/93036/1 "2007-04-26T20:08:17Z")

</div>

I have written one plugin which defines some models.  
I have a number of other plugins that depend on the first plugin  
I would like to have the later plugins extend the model in the first  
by adding ‘has\_many’ associations to it.

I have tried like this:

module ActiveRecord  
class Base  
class FirstModel  
has\_many :second\_models  
end  
end  
end

and various other variants but I can’t seem to be able to call the  
‘has\_man’ method on a model that is already defined. Is there a simple  
way to achieve this? It seems like there should be.

Any suggestions would be appreciated.

-felix
