Hi guys,
Answering my own question in case it helps others.
Devise is considered a kind of "reference" Engine, and the way they do
it is in lib/devise.rb, they use autoload for the classes defined in
their lib folder. For instance:
autoload :Delegator, ''devise/delegator''
It worked for me.
Thanks
PJ
On Jan 7, 3:49 pm, PierreW
<wamre...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> Hi guys,
>
> In my "fooengine" mountableengine, I have subfolders within the
app/
> models/fooengine folder. For example:
> app/models/fooengine/core_models/foo.rb
>
> In order to have these files loaded, I added:
> config.autoload_paths+= %W(#{config.root}/app/models/fooengine/
> core_models)
> to lib/fooengine/engine.rb.
>
> But it gives an error:
> LoadError: Expected ... to define Foo
> and indeed, the fully qualified name is FooengineFoo, not Foo so the
> auto loader is lost.
>
> It works if I rename all my model files to fooengine_(model name).rb,
> but I guess there probably is a better way.
>
> Do you know?
>
> Thanks a lot!
> PJ
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.