diff --git a/db/migrate/20150915141403_apply_short_plus_pic_to_all_communities_blogs.rb b/db/migrate/20150915141403_apply_short_plus_pic_to_all_communities_blogs.rb new file mode 100644 index 0000000..24de7bb --- /dev/null +++ b/db/migrate/20150915141403_apply_short_plus_pic_to_all_communities_blogs.rb @@ -0,0 +1,23 @@ +class ApplyShortPlusPicToAllCommunitiesBlogs < ActiveRecord::Migration + def up + Community.all.each do |community| + set_short_plus_pic_to_blog community.blog + end + + puts "" + end + + def down + say "This can't be reverted" + end + + private + + def set_short_plus_pic_to_blog blog + if blog + blog.visualization_format = "short+pic" + blog.save! + print "." + end + end +end -- libgit2 0.21.2