Sha256: 50c77fb9a666c0508f4e93f241f5bbda034a6cb039dae1be0499ade670ffe07a
Contents?: true
Size: 627 Bytes
Versions: 8
Compression:
Stored size: 627 Bytes
Contents
class AddImageFileFormatToAlchemyPictures < ActiveRecord::Migration def up add_column :alchemy_pictures, :image_file_format, :string say_with_time "Storing file format of existing pictures" do Alchemy::Picture.all.each do |pic| begin format = pic.image_file.identify('-ping -format "%m"') pic.update_column('image_file_format', format.to_s.chomp.downcase) rescue Dragonfly::Job::Fetch::NotFound => e say(e.message, true) end end Alchemy::Picture.count end end def down remove_column :alchemy_pictures, :image_file_format end end
Version data entries
8 entries across 8 versions & 1 rubygems