allow defaults
Reported by Gaius Centus Novus | March 31st, 2008 @ 03:36 PM
I'd like to be able to change the value for @path in a Papaerclip::Attachment based on whether I'm in development, testing, or production. I could do this in my model:
has_attached_file :avatar, :path => {:production => ..., :test => ...}[ENV['RAILS_ENV']], ...
but it's not very elegant. I'd rather do this in my config/environments/xxx.rb:
Paperclip::Attachment::DEFAULTS[:path] = '...'
and not specify a path in my model unless I really want to override it.
Oddly, the outdated file_column does this the right way.
Comments and changes to this ticket
-

-
Jon Yurek April 3rd, 2008 @ 11:26 AM
- → State changed from new to resolved
- → Assigned user changed from to Jon Yurek
-
Jon Yurek April 16th, 2008 @ 05:54 PM
- → State changed from resolved to duplicate
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
