paperclip to_file replacement to duplicate files after create

100 views
Skip to first unread message

Daniel Lorenz

unread,
Jun 1, 2012, 4:13:10 PM6/1/12
to papercli...@googlegroups.com
Hi Guys,

I updated paperclip to new version and missing "to_file". I read the issue-tracker on github and search in this group, but i can't find a proper answer.
I have a Container-Model where a user can upload sample images. Each Container has many related Samples. For each Sample which is associated
to a Container a copy of the uploaded image should copied if a Sample has no own Image.

In my Container-Model I has a method with this part:

      mediaassets.each do |mediaasset|
        unless self.asset_file_name.nil?
          mediaasset.asset = self.asset.to_file
        end
        mediaasset.save!
      end

How can I fix this?

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages