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

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

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

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!