Fixed warnings.
This commit is contained in:
parent
0d26851a5e
commit
575fb17964
2 changed files with 18 additions and 12 deletions
|
@ -376,7 +376,7 @@ class TicketOverviewsController < ApplicationController
|
|||
|
||||
# load article ids
|
||||
# if item.history_object == 'Ticket'
|
||||
tickets.push Ticket.find(item.o_id)
|
||||
tickets.push Ticket.find( item['o_id'] )
|
||||
# end
|
||||
# if item.history_object 'Ticket::Article'
|
||||
# tickets.push Ticket::Article.find(item.o_id)
|
||||
|
@ -386,8 +386,8 @@ class TicketOverviewsController < ApplicationController
|
|||
# end
|
||||
|
||||
# load users
|
||||
if !users[item.created_by_id]
|
||||
users[item.created_by_id] = user_data_full(item.created_by_id)
|
||||
if !users[ item['created_by_id'] ]
|
||||
users[ item['created_by_id'] ] = user_data_full( item['created_by_id'] )
|
||||
end
|
||||
}
|
||||
|
||||
|
@ -411,7 +411,7 @@ class TicketOverviewsController < ApplicationController
|
|||
|
||||
# load article ids
|
||||
# if item.history_object == 'Ticket'
|
||||
tickets.push Ticket.find(item.o_id)
|
||||
tickets.push Ticket.find( item['o_id'] )
|
||||
# end
|
||||
# if item.history_object 'Ticket::Article'
|
||||
# tickets.push Ticket::Article.find(item.o_id)
|
||||
|
@ -421,8 +421,8 @@ class TicketOverviewsController < ApplicationController
|
|||
# end
|
||||
|
||||
# load users
|
||||
if !users[item.created_by_id]
|
||||
users[item.created_by_id] = user_data_full(item.created_by_id)
|
||||
if !users[ item['created_by_id'] ]
|
||||
users[ item['created_by_id'] ] = user_data_full( item['created_by_id'] )
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
@ -25,12 +25,15 @@ class History < ActiveRecord::Base
|
|||
where( :history_type_id => History::Type.where( :name => ['created', 'updated']) ).
|
||||
order('created_at DESC, id DESC').
|
||||
limit(10)
|
||||
datas = []
|
||||
stream.each do |item|
|
||||
item['history_object'] = item.history_object
|
||||
item['history_type'] = item.history_type
|
||||
data = item.attributes
|
||||
data['history_object'] = item.history_object
|
||||
data['history_type'] = item.history_type
|
||||
datas.push data
|
||||
# item['history_attribute'] = item.history_attribute
|
||||
end
|
||||
return stream
|
||||
return datas
|
||||
end
|
||||
|
||||
def self.recent_viewed(user)
|
||||
|
@ -40,12 +43,15 @@ class History < ActiveRecord::Base
|
|||
where( :history_type_id => History::Type.where( :name => ['viewed']) ).
|
||||
order('created_at DESC, id DESC').
|
||||
limit(10)
|
||||
datas = []
|
||||
stream.each do |item|
|
||||
item['history_object'] = item.history_object
|
||||
item['history_type'] = item.history_type
|
||||
data = item.attributes
|
||||
data['history_object'] = item.history_object
|
||||
data['history_type'] = item.history_type
|
||||
datas.push data
|
||||
# item['history_attribute'] = item.history_attribute
|
||||
end
|
||||
return stream
|
||||
return datas
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue