Added TaskList and Task migrations and models

This commit is contained in:
Jason Denney
2013-02-08 22:10:52 -05:00
parent ec19c8461d
commit 545c33b953
6 changed files with 54 additions and 2 deletions
+2 -1
View File
@@ -2,10 +2,11 @@ class Bike < ActiveRecord::Base
acts_as_loggable
attr_accessible :serial_number, :bike_brand_id, :bike_model_id, :color, :bike_style_id, :seat_tube_height,
:top_tube_length, :wheel_size, :value, :bike_condition_id, :bike_status_id
has_many :transactions
has_one :owner, :class_name => 'User'
has_one :task_list, :as => :item, :dependent => :destroy
belongs_to :bike_brand
belongs_to :bike_model
belongs_to :bike_style
+9
View File
@@ -0,0 +1,9 @@
class Task < ActiveRecord::Base
attr_accessible :task, :notes, :done
belongs_to :task_list
def to_s
self.task
end
end
+10
View File
@@ -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