Thanks!

How do you process the image in the model?

Before the save of the model object to database I want to add another 
image to it, that is a modified version of the "image" attribute.

I do:
  has_attached_file :image
  has_attached_file :image2
  after_validation :prepare_image2

And:
  def cprepare_image2
   (...)
   path = image.queued_for_write[:original].path
   self.image2 = some_rmagic_processing(path)
   (...)
  end

Is there any other way to access the uploaded image? 
"image.queued_for_write[:original].path" does not look nice :/

May be use an other callback?

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to