diff --git a/app/models/bike_brand.rb b/app/models/bike_brand.rb new file mode 100644 index 0000000..ed16f36 --- /dev/null +++ b/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 diff --git a/app/models/bike_model.rb b/app/models/bike_model.rb new file mode 100644 index 0000000..5c18481 --- /dev/null +++ b/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