From d7e974f40930fbb6fc310907eeb5cf7d9785f8d3 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 2 May 2012 13:57:23 +0200 Subject: [PATCH] Fixed recent_viewed(). --- app/models/history.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/history.rb b/app/models/history.rb index 4d5f72f28..7f0db9b04 100644 --- a/app/models/history.rb +++ b/app/models/history.rb @@ -42,6 +42,7 @@ class History < ActiveRecord::Base stream = History.select("distinct(histories.o_id), created_by_id, history_attribute_id, history_type_id, history_object_id, value_from, value_to"). where( :history_object_id => History::Object.where( :name => 'Ticket').first.id ). where( :history_type_id => History::Type.where( :name => ['viewed']) ). + where( :created_by_id => user.id ). order('created_at DESC, id DESC'). limit(10) datas = []