mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-10-11 11:16:08 -04:00
Order bike brands and models alphabetically
This commit is contained in:
@@ -4,6 +4,8 @@ class BikeBrand < ActiveRecord::Base
|
|||||||
has_many :bikes
|
has_many :bikes
|
||||||
has_many :bike_models
|
has_many :bike_models
|
||||||
|
|
||||||
|
default_scope order('brand ASC')
|
||||||
|
|
||||||
self.per_page = 15
|
self.per_page = 15
|
||||||
|
|
||||||
def models
|
def models
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
class BikeModel < ActiveRecord::Base
|
class BikeModel < ActiveRecord::Base
|
||||||
attr_accessible :model
|
attr_accessible :model, :bike_brand_id
|
||||||
|
|
||||||
has_many :bikes
|
has_many :bikes
|
||||||
belongs_to :bike_brand
|
belongs_to :bike_brand
|
||||||
|
|
||||||
|
default_scope order('model ASC')
|
||||||
|
|
||||||
self.per_page = 15
|
self.per_page = 15
|
||||||
|
|
||||||
def brand
|
def brand
|
||||||
|
|||||||
Reference in New Issue
Block a user