Jörg Battermann
2008-Dec-28 05:50 UTC
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Dec-28 10:57 UTC
Re: My own Model declarations do not overwrite/replace plugin''s ones?
On 28 Dec 2008, at 05:50, Jörg Battermann wrote:> > 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? >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> > Cheers and thanks, > -J > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip
2008-Dec-28 15:54 UTC
Re: My own Model declarations do not overwrite/replace plugin''s ones?
Frederick Cheung wrote:> Jörg Battermann wrote:>> 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? >> > 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! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---