Fixed recent_viewed().

This commit is contained in:
Martin Edenhofer 2012-05-02 13:57:23 +02:00
parent 36de5d809b
commit d7e974f409

View file

@ -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"). 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_object_id => History::Object.where( :name => 'Ticket').first.id ).
where( :history_type_id => History::Type.where( :name => ['viewed']) ). where( :history_type_id => History::Type.where( :name => ['viewed']) ).
where( :created_by_id => user.id ).
order('created_at DESC, id DESC'). order('created_at DESC, id DESC').
limit(10) limit(10)
datas = [] datas = []