diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-16 09:09:25 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-16 09:09:25 +0100 |
commit | 36535f44d6de2f40e69ffe1e90210aa263e84a6b (patch) | |
tree | 8c112a6a25dffaf1b48922d9766dd0280918fc03 | |
parent | 3a6a39461ca3926062f74720c08ebc921e1fc32e (diff) |
Limit the number of results returned on the wall
-rw-r--r-- | app/controllers/user_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 18fae7024..72e9f63f1 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -122,11 +122,11 @@ class UserController < ApplicationController end for track_thing in @track_things # XXX factor out of track_mailer.rb - xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 100, 1) + xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 20, 1) feed_results += xapian_object.results.map {|x| x[:model]} end - @feed_results = Array(feed_results).sort {|x,y| y.created_at <=> x.created_at} + @feed_results = Array(feed_results).sort {|x,y| y.created_at <=> x.created_at}.first(20) respond_to do |format| format.html { @has_json = true } |