mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Added TaskList and Task migrations and models
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user