From 9ede7859490742e01889db0db4e61b9af588013a Mon Sep 17 00:00:00 2001 From: tony Date: Tue, 14 Apr 2009 14:51:00 +0000 Subject: First pass at 'river of news' style listing of what's been happening with things you're tracking. --- app/controllers/user_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/user_controller.rb') 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 -- cgit v1.2.3