On Mon, Sep 17, 2007 at 05:48:08AM +0200, Subimage Interactive wrote:
> Reviving a 2 year old thread, how is everyone extending their models in
> engines these days?
> 
> I'm attempting to move Substruct to a module system as described here:
> http://www.ruby-forum.com/topic/51339
> 
> 
> ...but I'm getting a ton of errors like this one:
> 
> "undefined method `has_and_belongs_to_many' for Substruct::Tag:Module"
> 
> So what good is that method if you have to redeclare the associations in
> the class, and not within the module itself?
> 
> Any ideas or tricks that people are using to get around this? Copying /
> pasting models into app/models to extend is getting tiresome, but this
> workaround seems pretty hackish as well.

See http://www.ruby-forum.com/topic/98597.  This turned out not to work 100%,
as we found out in http://www.ruby-forum.com/topic/99211

Short and simple:

In app/models/foo.rb:

require_dependency RAILS_ROOT + "vendor/plugin/my_plugin/app/models/foo"

class Foo < ActiveRecord::Base
  # extend here
end

Hope this helps,
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

Reply via email to