Sha256: f38670d108db86cb6413ea50e29728f84731d8e8637d845dd6564bacad530c10
Contents?: true
Size: 584 Bytes
Versions: 21
Compression:
Stored size: 584 Bytes
Contents
class ConvertTitlePrefixSetting < ActiveRecord::Migration class BareBlog < ActiveRecord::Base include BareMigration serialize :settings, Hash end def self.up BareBlog.find(:all).each do |b| if b.settings.has_key? "title_prefix" b.settings["title_prefix"] = (b.settings["title_prefix"] ? 1 : 0) b.save! end end end def self.down BareBlog.find(:all).each do |b| if b.settings.has_key? "title_prefix" b.settings["title_prefix"] = (b.settings["title_prefix"] == 1) b.save! end end end end
Version data entries
21 entries across 21 versions & 1 rubygems