Sha256: a4a9609b12ee77d8e9add42a0a707e267230b60318305e7d9c26be3c34f77f41
Contents?: true
Size: 498 Bytes
Versions: 27
Compression:
Stored size: 498 Bytes
Contents
class AddNestedSetToPostCategories < ActiveRecord::Migration def up change_table :spud_post_categories do |t| t.integer :lft t.integer :rgt t.integer :depth end # Populates lft, rgt, and depth values for nested set SpudPostCategory.where(:parent_id => 0).update_all({:parent_id => nil}) SpudPostCategory.rebuild! end def down change_table :spud_post_categories do |t| t.remove :ltf t.remove :rgt t.remove :depth end end end
Version data entries
27 entries across 27 versions & 2 rubygems