Forum: Ruby on Rails My own Model declarations do not overwrite/replace plugin's ones?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jörg B. (Guest)
on 2008-12-28 07:51
(Received via mailing list)
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
Frederick C. (Guest)
on 2008-12-28 12:58
(Received via mailing list)
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
Phlip (Guest)
on 2008-12-28 17:55
(Received via mailing list)
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!
This topic is locked and can not be replied to.