Velocipede's User, Sales, and Bike Inventory Web App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
567 B

class Tasks < Netzke::Basepack::Grid
def configure(c)
super
c.model = "Task"
c.scope = lambda{ |rel|
if session[:selected_bike_id]
rel.where(:task_list_id => Bike.find_by_id(session[:selected_bike_id]).task_list.id)
else
#show nothing, whatever this works
rel.where(:task_list_id => 0)
end
}
end
#override with nil to remove actions
def default_bbar
[ :apply, :add_in_form]
end
end