最初は db mysql を使用していますが、次に postgres に変更します。
SQLからpostgresにdbを複製する関数をいくつか書きます。そして、Image テーブルからの clone db に問題があります。
ImageClone.all.each do |p|
img = Image.new()
img.imageable_id = p.imageable_id
img.imageable_type = p.imageable_type
img.uploader = p.uploader
puts p.uploader #=> 'testing_image.jpg'
img.save
end
=> #<Image id: 1, imageable_id: 1, imageable_type: "ProductType", uploader: nil>
画像の URL = 'testing_image.jpg' を設定するにはどうすればよいですか。なにか提案を?