I am toying around with a plugin for file uploads (
http://github.com/jnicklas/carrierwave/tree/master if anyone is interested),
the thing that separates it from the gajiliion other file upload plugins out
there is that I have all the upload logic in a separate file. And I would
like to put this file in a directory under 'app' called 'uploaders', so I
can have:
app
- models
- user.rb
app
- uploaders
- avatar_uploader.rb
and then in my user model, I can mount the avatar uploader like this:
class User
property :avatar, String
mount_uploader :avatar, AvatarUploader
end
seems simple enough, but I cannot make it work in Merb. It fails on boot
with:
uninitialized constant User::AvatarUploader - (NameError)
however, when the boot is completed, AvatarUploader is available, so there
is nothing wrong with my push_paths declaration, and it seems to me that
this is a load order issue. I am guessing (pure conjecture) that this is
caused by plugins being loaded after models?
Any ideas what I am doing wrong?
/Jonas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---