diff options
author | francis <francis> | 2008-09-02 23:50:27 +0000 |
---|---|---|
committer | francis <francis> | 2008-09-02 23:50:27 +0000 |
commit | 3f1ddfe615bce2cb1b0856c69a3e3c9fc966311a (patch) | |
tree | 12e32ed0433dbe236520380e9fce45ab086506aa /app/models/track_thing.rb | |
parent | 0702be9d52f0b41222be7fe61789a6862749a818 (diff) |
Group tracks on user page.
Diffstat (limited to 'app/models/track_thing.rb')
-rw-r--r-- | app/models/track_thing.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 9bb771961..f014c215a 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -21,7 +21,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_thing.rb,v 1.38 2008-08-31 12:46:53 francis Exp $ +# $Id: track_thing.rb,v 1.39 2008-09-02 23:50:27 francis Exp $ class TrackThing < ActiveRecord::Base belongs_to :tracking_user, :class_name => 'User' @@ -48,6 +48,25 @@ class TrackThing < ActiveRecord::Base 'feed' ] + def TrackThing.track_type_description(track_type) + if track_type == 'request_updates' + "Individual requests" + elsif track_type == 'all_new_requests' || track_type == "all_successful_requests" + "Many requests" + elsif track_type == 'public_body_updates' + "Public authorities" + elsif track_type == 'user_updates' + "People" + elsif track_type == 'search_query' + "Search queries" + else + raise "internal error " + track_type + end + end + def track_type_description + TrackThing.track_type_description(self.track_type) + end + def TrackThing.create_track_for_request(info_request) track_thing = TrackThing.new track_thing.track_type = 'request_updates' |