Skip to content

Commit

Permalink
fixed down method in file_column to paperclip migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
molpe committed Jan 22, 2009
1 parent b61ff50 commit 3a3a77e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions db/migrate/002_add_attachments_icon_to_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ def self.up
end

def self.down
add_column :profiles, :image
add_column :profiles, :icon, :string

remove_crop("plugins.tog_social.profile.image.versions.big")
remove_crop("plugins.tog_social.profile.image.versions.medium")
remove_crop("plugins.tog_social.profile.image.versions.small")
remove_crop("plugins.tog_social.profile.image.versions.tiny")

Profile.all.each do |p|
unless p.image_file_name.blank?
p.icon = File.new("public/system/profiles/images/#{p.id}/#{p.image_file_name}") if File.exists?("public/system/profiles/images/#{p.id}/#{p.image_file_name}")
unless p.icon_file_name.blank?
p.icon = File.new("public/system/profiles/images/#{p.id}/#{p.icon_file_name}") if File.exists?("public/system/profiles/images/#{p.id}/#{p.icon_file_name}")
p.save!
end
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/003_add_attachments_image_to_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def self.up
end

def self.down
add_column :groups, :image
add_column :groups, :image, :string

remove_crop("plugins.tog_social.group.image.versions.big")
remove_crop("plugins.tog_social.group.image.versions.medium")
Expand Down

0 comments on commit 3a3a77e

Please sign in to comment.