Sha256: 257e7f6c4724b827292516bcec36afed4dcdbdb26e4eec92fc8f5bc1af8d55f2
Contents?: true
Size: 503 Bytes
Versions: 6
Compression:
Stored size: 503 Bytes
Contents
class GroupsNestedSet < ActiveRecord::Migration def self.up add_column :groups, :parent_id, :integer add_column :groups, :root_group_id, :integer add_column :groups, :lft, :integer add_column :groups, :rgt, :integer Group.reset_column_information Group.rebuild! Group.all.each {|g| g.save } end def self.down remove_column :groups, :parent_id remove_column :groups, :root_group_id remove_column :groups, :lft remove_column :groups, :rgt end end
Version data entries
6 entries across 6 versions & 1 rubygems