I'm working on a Rails app using attachment_ fu and Amazon S3 storage. Is it possible to make the :s3_ access (a part of the has_attachment options) conditional based on a user input when creating the object. I would like the user to be able if to select if the attachment is authenticated-read or public-read. Is this possible and how would you setup the conditional statement?
My model looks like this:
has_attachment :content_type => :image,
:storage => :s3,
:size => 0.kilobytes..6144.kilobytes,
:processor => 'Rmagick',
:resize_to => '650x500>',
:thumbnails => { :thumb => '75x75!' },
:s3_access => ( [[conditional]] ? 'authenticated-read' : 'public-read' )
Obviously [[conditional]] is what I'm looking to replace, but I don't know how to correctly setup a conditional for the item based off user action in the model. Maybe this is the wrong time of conditional for this type statement. Any suggestions?