blob: 525c96782330592eb6db6c782f91f3a8fa325e7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# app/controllers/admin_track_controller.rb:
# Show email alerts / RSS feeds from admin interface.
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
class AdminTrackController < AdminController
def list
@query = params[:query]
@admin_tracks = TrackThing.paginate :order => "created_at desc", :page => params[:page], :per_page => 100,
:conditions => @query.nil? ? nil : ["lower(track_query) like lower('%'||?||'%')", @query ]
@popular = ActiveRecord::Base.connection.select_all("select count(*) as count, title, info_request_id from track_things join info_requests on info_request_id = info_requests.id where info_request_id is not null group by info_request_id, title order by count desc limit 10;")
end
private
end
|