How to migrate old images saved by Paperclip to new styles and save it to s3 (and not saving the new files locally) ? (Rails) -


I used to use Rail (4.0.1) with paperclip (4.2.0) to save some images in S3 I am here.

I used to have a model property image:

  class property image & lt; ActiveRecord :: Base has_attached_file: painting, storage :: s3, s3_credentials: CONFIG [ 's3'], s3_protocol: (Rails.env.development? "Http": "https") end  

Now I want to transfer old images to new sizes, so I updated the model:

  class PropertyImage & lt; ActiveRecord :: Base has_attached_file: painting, storage :: s3, s3_credentials: CONFIG [ 's3'], s3_protocol: (Rails.env.development? "Http": "https"), Style: {thumb: '100x100 & gt; ' , Large: '633x460 & gt;', Medium: '301x240 & gt;' }  

  RAILS_ENV = D Bundle Exec rack paperclip refresh Class = property Image  

And when I see the logs do, I get :

  (0.2ms) BEGIN Property Load (0.7 ms) "Select" from "Properties" (where hidden I is hidden or I have hidden) and "Property". "Id" = $ 1 "Properties" by ORDER "Id" ASC LIMIT 1 [[ "id", 20]] SQL (0.6 mms) Update "Properties" SET "Apdeted_at" = "2014-10-28 12: 33: 58.382649 'where' quality '." Id "= 20 (1.7 ms)) COMMIT [paperclip] copying /property_images/pictures/000/000/074/original/e9ad004a-09f1-4af3-85c3-772fe3e99acd.gif local file / var / folders / g8 / 3v37gc0x16b313mvf7464qtc0000gn / T / 2c5a0dd4db750ff6c32b123df2d933ce20141028-28547-j997pz GIF [AWS S3 200 0.209569 0 Comments] get_object (: balt_name = & gt; "babylon_development" ,: key => "property_image / image / 000/00  

Two things that I have seen here:

1- Dana is trying to localize the original images on / var / folders / * (not on s3) < / P>

2 - grains of different sizes (thumbs, large And medium) is not being made

Any help will be highly appreciated

I missing_styles just like:

  Bundle App Reich paperclip: Refresh: missing_styles class = PropertyImage  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -