Skip to content

Commit

Permalink
In page seeds update slug for each page separately instead of using
Browse files Browse the repository at this point in the history
update_all because otherwise it fails when using mysql. Fixes refinery#1919.
  • Loading branch information
ugisozols committed Sep 7, 2012
1 parent 66640be commit 00f1c92
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pages/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
end
end


(Refinery.i18n_enabled? ? Refinery::I18n.frontend_locales : [:en]).each do |lang|
I18n.locale = lang
{'home' => "Home",
'page-not-found' => 'Page not found',
'about' => 'About'
}.each do |slug, title|
Refinery::Page.by_title(title).update_all(:slug => slug)
Refinery::Page.by_title(title).each { |page| page.update_attributes(:slug => slug) }
end
end

0 comments on commit 00f1c92

Please sign in to comment.