Sha256: 7790b8c8b03ecf945ce55f6d0fcd7d5fccb1fb6a7bd7072483ec987fbfcf776b
Contents?: true
Size: 406 Bytes
Versions: 4
Compression:
Stored size: 406 Bytes
Contents
class MoveEditorToUser < ActiveRecord::Migration def self.up add_column :users, :editor, :integer, :default => 2 unless $schema_generator blog = Blog.default editor = blog.editor users = User.find(:all) users.each do |user| user.editor = editor.to_i user.save! end end end def self.down remove_column :users, :editor end end
Version data entries
4 entries across 4 versions & 1 rubygems