app/controllers/flyboy/goals_controller.rb in flyboy-1.0.4 vs app/controllers/flyboy/goals_controller.rb in flyboy-1.0.5
- old
+ new
@@ -12,21 +12,25 @@
@goals ||= Goal.all
@order ||= sortable_column_order do |column, direction|
case column
- when "title"
+ when "title", "status"
%(LOWER(flyboy_goals.#{column}) #{direction})
+ when "progress"
+ %(flyboy_goals.#{column} #{direction})
else
params["sort"] = "status"
"status ASC"
end
end
@filters ||= SmallData::FilterForGoals.new(cookies)
@goals = @goals.order(@order)
- @goals = @filters.apply @goals
+ @goals = @filters.apply(@goals)
+ @goals = @goals.search(params[:q])
+ @goals = @goals.page(params[:page])
end
def show
authorize! :read, @goal
end