Commit 4ef1070c53697b9512732c996c2c35ffe7cfdca7

Authored by Daniela Feitosa
1 parent 9173ce0f

Added Thumbnail on migration

Also included new db/schema.rb

(ActionItem2032)
db/migrate/20110706171330_fix_misunderstood_script_filename.rb
... ... @@ -36,12 +36,18 @@ class FixMisunderstoodScriptFilename < ActiveRecord::Migration
36 36 image.create_thumbnails
37 37 end
38 38  
39   - UploadedFile.all.select { |u| u.content_type != 'text/plain' && File.extname(u.filename) == '.txt' }.map do |uploaded_file|
  39 + UploadedFile.all.select { |u| u.image? && File.extname(u.filename) == '.txt' }.map do |uploaded_file|
40 40 uploaded_file.thumbnails.destroy_all
41 41 uploaded_file.filename = fixed_name(uploaded_file)
42 42 uploaded_file.save!
43 43 uploaded_file.create_thumbnails
44 44 end
  45 +
  46 + Thumbnail.all.select { |u| u.image? && File.extname(u.filename) == '.txt' }.map do |thumbnail|
  47 + thumbnail.filename = fixed_name(thumbnail)
  48 + thumbnail.save!
  49 + end
  50 +
45 51 end
46 52  
47 53 def self.down
... ...
db/schema.rb
... ... @@ -9,7 +9,7 @@
9 9 #
10 10 # It's strongly recommended to check this file into your version control system.
11 11  
12   -ActiveRecord::Schema.define(:version => 20110527042608) do
  12 +ActiveRecord::Schema.define(:version => 20110706171330) do
13 13  
14 14 create_table "action_tracker", :force => true do |t|
15 15 t.integer "user_id"
... ...