From 0d5fd7ba5092b4d00826f3572448bb54ac2ec983 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 17:14:12 +0100 Subject: Limit call_histories to 1000 and add caching. --- app/controllers/call_histories_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/call_histories_controller.rb') diff --git a/app/controllers/call_histories_controller.rb b/app/controllers/call_histories_controller.rb index f711f34..5335ed3 100644 --- a/app/controllers/call_histories_controller.rb +++ b/app/controllers/call_histories_controller.rb @@ -34,6 +34,8 @@ class CallHistoriesController < ApplicationController if ! @type.blank? @call_histories = @call_histories.where(:entry_type => @type) end + + @call_histories = @call_histories.order(:created_at).reverse_order.limit(1000) end -- cgit v1.2.3