Browse Source

Add BikeBrand and BikeModel models

denney-disable-on-select
Jason Denney 12 years ago
parent
commit
ff640580be
  1. 10
      app/models/bike_brand.rb
  2. 10
      app/models/bike_model.rb

10
app/models/bike_brand.rb

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

@ -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…
Cancel
Save