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

Edit to brand and model models

This commit is contained in:
Jason Denney 2012-12-08 16:56:16 -05:00
parent 29af72787b
commit 2876a20148
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,5 @@
class BikeBrand < ActiveRecord::Base
attr_accessible :name
attr_accessible :brand
has_many :bikes
has_many :bike_models
@ -9,4 +9,8 @@ class BikeBrand < ActiveRecord::Base
def models
self.bike_models
end
def to_s
self.brand
end
end

View File

@ -1,10 +1,16 @@
class BikeModel < ActiveRecord::Base
attr_accessible :name
attr_accessible :model
has_many :bikes
belongs_to :bike_brand
self.per_page = 15
def brand
self.bike_brand
end
def to_s
self.model
end
end