Browse files

fixed upgrade migration

  • Loading branch information...
1 parent 92717bf commit ca03d0aba1030e67f43300d01619371976036df1 jipiboily committed Jun 2, 2012
Showing with 8 additions and 12 deletions.
  1. +8 −12 db/migrate/20120526131841_migrate_old_urls.rb
View
20 db/migrate/20120526131841_migrate_old_urls.rb
@@ -1,23 +1,19 @@
class MigrateOldUrls < ActiveRecord::Migration
def up
mount_point = Monologue::Engine.routes.url_helpers.root_path
- if mount_point != "/"
- Monologue::PostsRevision.all.each do |r|
- next if r.url.nil?
- r.url = r.url.sub(mount_point, "")
- r.save!
- end
+ Monologue::PostsRevision.all.each do |r|
+ next if r.url.nil?
+ r.url = r.url.sub(mount_point, "")
+ r.save!
end
end
def down
mount_point = Monologue::Engine.routes.url_helpers.root_path
- if mount_point != "/"
- Monologue::PostsRevision.all.each do |r|
- next if r.url.nil?
- r.url = mount_point + r.url
- r.save!
- end
+ Monologue::PostsRevision.all.each do |r|
+ next if r.url.nil?
+ r.url = mount_point + r.url
+ r.save!
end
end
end

0 comments on commit ca03d0a

Please sign in to comment.