mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Fixed default sort and added migration for shop_id => Integer
This commit is contained in:
@@ -33,6 +33,10 @@ class Bikes < Netzke::Basepack::Grid
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
# Default the sorting to ASC on shop_id
|
||||
c.data_store.sorters = [{ property: 'shop_id', direction: 'ASC' }]
|
||||
|
||||
@bike = Bike.all
|
||||
c.prohibit_update = true if cannot? :update, @bike
|
||||
c.prohibit_create = true if cannot? :create, @bike
|
||||
|
||||
+1
-3
@@ -12,9 +12,7 @@ class Bike < ActiveRecord::Base
|
||||
belongs_to :bike_condition
|
||||
belongs_to :bike_purpose
|
||||
|
||||
default_scope order('shop_id ASC')
|
||||
|
||||
validates :shop_id, :presence => true, :uniqueness => true, :length => { :minimum => 3 }
|
||||
validates :shop_id, :presence => true, :uniqueness => true, :numericality => { :only_integer => true }
|
||||
validates :serial_number, :length => { :minimum => 3 }
|
||||
validates :model, :length => { :maximum => 50 }
|
||||
validates :bike_brand_id, :presence => true
|
||||
|
||||
Reference in New Issue
Block a user