Weird. I decided to test the default behavior before trying your
suggestion and it worked the opposite of how its been documented. My
app/models/Tag.rb loaded in place of plugin/models/Tag.rb. I can' say
for sure which order the classes were loaded in but the end result was
that the associations created by the plugin version were ignored in
favor of the ones created in my app model.
Perhaps this is unique to HMP? In any event, its good to know the
workaround which I'm sure to need at some future point. I also agree
it should go in FAQ (along with a description of the load order for
views, helpers and controllers.)
Thanks for the help.
Sean
On 10/9/07, Peter Bex <[EMAIL PROTECTED]> wrote:
> On Mon, Oct 08, 2007 at 01:36:32PM -0400, Sean Schofield wrote:
> > I seem to recall reading that engines will not allow you to override
> > your plugin models in the main application. Is that true?
>
> It won't work properly with autoloading. You'll have to it manually.
> Just put
>
> require_dependency
> "#{RAILS_ROOT}/vendor/plugins/my_engine/app/models/my_model.rb"
>
> just before the class definition in RAILS_ROOT/app/models.
>
> James, this seems to be a FAQ. Can you include it on the website's
> FAQ page? Thanks.
>
> Regards,
> Peter Bex
> Solide ICT - http://www.solide-ict.nl
> _______________________________________________
> Engine-Users mailing list
> [email protected]
> http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
>
_______________________________________________
Engine-Users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org