aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authortony <tony>2009-04-14 14:51:00 +0000
committertony <tony>2009-04-14 14:51:00 +0000
commit9ede7859490742e01889db0db4e61b9af588013a (patch)
tree8b2c582056d309c1bf5dcc88e4d03bc7784de101 /app/controllers/user_controller.rb
parent0b0d0a70419e9891627f82584fa873f2c189750c (diff)
First pass at 'river of news' style listing of what's been happening
with things you're tracking.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 5809484f1..9a8b92e81 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user_controller.rb,v 1.64 2009-03-18 02:37:42 francis Exp $
+# $Id: user_controller.rb,v 1.65 2009-04-14 14:51:00 tony Exp $
class UserController < ApplicationController
# Show page about a user
@@ -261,6 +261,12 @@ class UserController < ApplicationController
end
+ # River of News: What's happening with your tracked things
+ def river
+ @results = @user.track_things.collect { |thing|
+ perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results
+ }.flatten.sort { |a,b| b[:model].created_at <=> a[:model].created_at }.first(20)
+ end
private