mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
12 years ago
6 changed files with 54 additions and 2 deletions
@ -0,0 +1,9 @@ |
|||
class Task < ActiveRecord::Base |
|||
attr_accessible :task, :notes, :done |
|||
|
|||
belongs_to :task_list |
|||
|
|||
def to_s |
|||
self.task |
|||
end |
|||
end |
@ -0,0 +1,10 @@ |
|||
class TaskList < ActiveRecord::Base |
|||
attr_accessible :item_id, :item_type, :name |
|||
|
|||
belongs_to :item, :polymorphic => true |
|||
has_many :tasks |
|||
|
|||
def to_s |
|||
self.name |
|||
end |
|||
end |
@ -0,0 +1,9 @@ |
|||
class TaskList < ActiveRecord::Migration |
|||
def change |
|||
create_table :task_lists do |t| |
|||
t.integer "item_id", :null => false |
|||
t.string "item_type", :null => false |
|||
t.string "name", :null => false |
|||
end |
|||
end |
|||
end |
@ -0,0 +1,10 @@ |
|||
class Task < ActiveRecord::Migration |
|||
def change |
|||
create_table :tasks do |t| |
|||
t.integer "task_list_id", :null => false |
|||
t.string "task", :null => false |
|||
t.text "notes" |
|||
t.boolean "done" |
|||
end |
|||
end |
|||
end |
Loading…
Reference in new issue