mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
12 years ago
2 changed files with 20 additions and 0 deletions
@ -0,0 +1,10 @@ |
|||
class BikeBrand < ActiveRecord::Base |
|||
attr_accessible :name |
|||
|
|||
has_many :bikes |
|||
has_many :bike_models |
|||
|
|||
def models |
|||
self.bike_models |
|||
end |
|||
end |
@ -0,0 +1,10 @@ |
|||
class BikeModel < ActiveRecord::Base |
|||
attr_accessible :name |
|||
|
|||
has_many :bikes |
|||
belongs_to :bike_brand |
|||
|
|||
def brand |
|||
self.bike_brand |
|||
end |
|||
end |
Loading…
Reference in new issue