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