Retrospring/app/controllers/moderation_controller.rb

13 lines
374 B
Ruby
Raw Normal View History

2014-12-25 14:00:33 -08:00
class ModerationController < ApplicationController
2014-12-28 16:25:48 -08:00
before_filter :authenticate_user!
2014-12-25 14:00:33 -08:00
def index
2014-12-28 16:25:48 -08:00
@type = params[:type]
@reports = if @type == 'all'
Report.where(deleted: false).reverse_order
else
Report.where(deleted: false).where('LOWER(type) = ?', "reports::#{@type}").reverse_order
end
2014-12-25 14:00:33 -08:00
end
end