# My own Model declarations do not overwrite/replace plugin's ones?

**URL:** <https://www.ruby-forum.com/t/my-own-model-declarations-do-not-overwrite-replace-plugins-ones/156456>\
**Category:** Rails\
**Created:** [December 28, 2008, 6:51am UTC](https://www.ruby-forum.com/t/my-own-model-declarations-do-not-overwrite-replace-plugins-ones/156456 "2008-12-28T06:51:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [December 28, 2008, 6:51am UTC](https://www.ruby-forum.com/t/my-own-model-declarations-do-not-overwrite-replace-plugins-ones/156456/1 "2008-12-28T06:51:37Z")

</div>

Good Morning,

I have a quick Q: I am using the acts\_as\_follower plugin which comes  
with its own ‘Follow’ model (lib/follow.rb). Now what I wanted to do  
is basically take this, copy it from the vendor/plugins/… to app/  
models/ and start modifying it from there.

However, as it turns out… none of the code in my app/models/  
follow.rb file is loaded/run/available… only the one specified in  
the vendor/plugins/acts\_as\_follower/lib/follow.rb one.

Is this wanted that way? Or what can I do in this case?

Cheers and thanks,  
-J

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [December 28, 2008, 11:58am UTC](https://www.ruby-forum.com/t/my-own-model-declarations-do-not-overwrite-replace-plugins-ones/156456/2 "2008-12-28T11:58:38Z")

</div>

On 28 Dec 2008, at 05:50, Jörg Battermann wrote:

> the vendor/plugins/acts\_as\_follower/lib/follow.rb one.
> 
> Is this wanted that way? Or what can I do in this case?

What happens is that rails has already loaded the one in the plugin so  
when it comes accross the Follow constant it’s not undefined so it  
doesn’t go off searching for a follow.rb (at least that’s what happens  
in dev mode).  
Explicitly requiring your own one might do the trick.

Fred

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [December 28, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/my-own-model-declarations-do-not-overwrite-replace-plugins-ones/156456/3 "2008-12-28T16:55:12Z")

</div>

Frederick C. wrote:

> Jörg Battermann wrote:

> > 
> 
> What happens is that rails has already loaded the one in the plugin so  
> when it comes accross the Follow constant it’s not undefined so it  
> doesn’t go off searching for a follow.rb (at least that’s what happens  
> in dev mode).  
> Explicitly requiring your own one might do the trick.

Change the name of your model. “Follow” is not an application-specific  
noun, anyway!
