From 12917fd868e4c50f837bad4ee99cc7186f3e7f36 Mon Sep 17 00:00:00 2001 From: ioBridge Date: Tue, 5 Apr 2011 16:31:07 -0400 Subject: [PATCH] allow results to be specified as a feed index parameter --- app/controllers/feed_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/feed_controller.rb b/app/controllers/feed_controller.rb index 1fe4b22..5dd233e 100644 --- a/app/controllers/feed_controller.rb +++ b/app/controllers/feed_controller.rb @@ -10,6 +10,9 @@ class FeedController < ApplicationController # set timezone correctly set_time_zone(params) + # set limits + limit = params[:results].to_i if params[:results] + # check for access if @success @@ -22,7 +25,8 @@ class FeedController < ApplicationController :all, :conditions => { :channel_id => channel.id, :created_at => get_date_range(params) }, :select => select_options, - :order => 'created_at desc' + :order => 'created_at desc', + :limit => limit ) # if a feed has data