Sha256: 96857302159f9d7e5bcf1624b45e6ca9f15931b03eb166b774176ae09947e749
Contents?: true
Size: 634 Bytes
Versions: 116
Compression:
Stored size: 634 Bytes
Contents
class AddSubtasks < ActiveRecord::Migration def self.up add_column :tasks, :parent_id, :integer, :references => :tasks add_column :backlogs, :enable_subtasks, :boolean, :null => false, :default => false end def self.down Task.find(:all).each do |task| task.period_id = task.root_task.period_id task.save! end remove_column :tasks, :parent_id remove_column :backlogs, :enable_subtasks end class Task < ActiveRecord::Base acts_as_tree :order => 'position' def root_task if parent parent.root_task else self end end end end
Version data entries
116 entries across 116 versions & 1 rubygems