1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00

Add BikeBrand and BikeModel models

This commit is contained in:
Jason Denney 2012-12-08 15:00:43 -05:00
parent a307d5f6d5
commit ff640580be
2 changed files with 20 additions and 0 deletions

10
app/models/bike_brand.rb Normal file
View File

@ -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

10
app/models/bike_model.rb Normal file
View File

@ -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