2010-06-08 3 views
27

시간이 지남에 따라 Deal 거래량의 엄지 손가락 크기가 변경되었습니다. 이러한 변경 사항을 통해 사용자가 사이트에 업로드 했으므로 엄지 손가락 크기가 다른 사용자는 거의 없습니다. 나는 reprocress 또는이 새로 고침 싶어, 그래서 난 내 루트로 가서 입력 :Paperclip을 새로 고치거나 다시 처리하려고 시도하는 중 작동하지 않음

rake paperclip:refresh class=Deal 

습니까 엄지 손가락 크기에 아무것도 .. 그럼 스크립트/콘솔 :

Deal.find (987) .reprocess!

NoMethodError: undefined method `reprocess!' for #<Deal:0xb68a0988> 
from /data/HQ_Channel/releases/20100607130346/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing' 
from (irb):7 

내 거래 클래스는 이것이다 :

이를 반환

=> Deal(id: integer, organization_id: integer, deal: string, value: string, what: string, description: string, image_file_name: string, image_content_type: string, image_file_size: integer, image_updated_at: datetime, created_at: datetime, updated_at: datetime, deal_image_file_name: string, deal_image_content_type: string, deal_image_file_size: integer, deal_image_uploaded_at: datetime) 

나는 현재 엄지 손가락에 엄지 손가락을 올바른 크기를 확인하기 위해 원본을 다시 처리하도록 할 수있는 일 크기 매개 변수?

업데이트 : 나는 attachment.rb을 Paperclip에 포함 시켰습니다. 흥미로운 점은 .save.updated_at과 같은 메소드가 작동한다는 것입니다. 그러나 reprocess!과 다른 몇 가지 방법은 그렇지 않습니다. 분명히 다른 냄새가 나나요?

답변

64

알 수 있습니다.

클립 클립은 모델 개체와 관련이 없기 때문에 모델 개체의 이미지 때문입니다.

Model.find(#).image.reprocess! 
+17

Model.find_each를 {참조 | thing.image.reprocess! } – Schneems

9

당신은 또한 포함 레이크 작업을 사용할 수 있습니다 : 그래서 적절한 작성, 그것은 다음과 같이 작동합니다 | 일

$ rake paperclip:refresh CLASS=Deal 

Paperclip Wiki

관련 문제