Skip to content

Commit

Permalink
Add migration to Update all page parts slug and title
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Sanchez committed Jul 20, 2015
1 parent 908a4be commit ff1aae2
Showing 1 changed file with 11 additions and 0 deletions.
@@ -0,0 +1,11 @@
class UpdateSlugAndTitleInRefineryPageParts < ActiveRecord::Migration
def change
Refinery::PagePart.all.each do |pp|
unless pp.title
pp.title = pp.slug
end
pp.slug = pp.slug.downcase.gsub(" ", "_")
pp.save!
end
end
end

0 comments on commit ff1aae2

Please sign in to comment.