title: Saving images with Carrierwave inside a ruby worker
body: <p>I'm trying to write a method to store an image from a given url, inside a ruby worker. It comes along my Rails app in which I display the object image.
  Here is what I've come up with : </p>
  
  <pre><code>def store(url)
      @object = Object.find(1)
      @object[:image] = CarrierWave::Uploader.store!(image_url)
  end
  </code></pre>
  
  <p>It doesn't seem to work at all. 
  Any clues?
  Is there another way around?</p>
  
  <p>[EDIT]</p>
  
  <p>Here is the current situation : </p>
  
  <pre><code>def store
    @object = Object.find(1)
    my_uploader = ImageUploader.new
  
    image = open("http://twitpic.com/show/iphone/xxxx.jpg") 
  # or for a local file:
    image = File.open(Rails.root.join('xxxx.png'))
  
    @object[:image] = my_uploader.store!(image)
    @object.save!
  end
  </code></pre>
  
  <p>The filename in the [:image] attibute is still wrong. It gives "[:store_versions!]". How do I get the filename right?</p>
  
  <p>[EDIT2]</p>
  
  <p>Got the filename right by adding <code>@artwork[:image] = my_uploader.filename</code> before save.
  But <code>@object = Object.find(1)</code> won't work. How do I access the Object class, which is inside my rails app, from the worker?</p>