Skip to content

Commit

Permalink
fix paperclip migration part one to not update updated_at columns in …
Browse files Browse the repository at this point in the history
…the transition
  • Loading branch information
Trevor Turk committed Jul 1, 2009
1 parent 2e5bc51 commit 88d531d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
13 changes: 0 additions & 13 deletions db/migrate/20090627234146_attachment_fu_to_paperclip_part_one.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,3 @@ def self.down
end
end
end

# create_table "uploads", :force => true do |t|
# t.integer "parent_id"
# t.string "content_type"
# t.string "filename"
# t.string "thumbnail"
# t.integer "size"
# t.integer "width"
# t.integer "height"
# t.integer "user_id"
# t.datetime "created_at"
# t.datetime "updated_at"
# end
1 change: 1 addition & 0 deletions lib/migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class Migrator

def self.attachment_fu_to_paperclip
%w(Avatar Upload Header Theme).each do |klass|
klass.constantize.record_timestamps = false
klass.constantize.find_each do |instance|
instance.update_attribute(:attachment_file_name, instance.filename)
instance.update_attribute(:attachment_content_type, instance.content_type)
Expand Down

0 comments on commit 88d531d

Please sign in to comment.