On 30 Oct 2008, at 13:56, Raphael Bauduin wrote:
Yes, but I'm looking at engines to be able to add this without
touching the main app.
Actually I'm building a new datatype for dedomenon.org , and it would
be great if it was possible without touching the main application's
code: just install the engine and you're done.
Isn't there a way to achieve this?
Thanks for your help!
In this case, you'll need to ensure that the main application
instance.rb model is loaded before you reopen the class in your
plugin. I would probably do something along the lines of
my_plugin/init.rb
require 'instance_extensions'
my_plugin/lib/instance_extensions.rb
require 'instance' # maybe raise an error here if it's missing in
the main app
Instance.class_eval do
has_many :web_file_attachments # ....
end
Hope that helps,
James
_______________________________________________
Engine-Users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org