diff --git a/app/controllers/recent_viewed_controller.rb b/app/controllers/recent_viewed_controller.rb index 9d4cc285a..0f58a9fee 100644 --- a/app/controllers/recent_viewed_controller.rb +++ b/app/controllers/recent_viewed_controller.rb @@ -19,7 +19,7 @@ curl http://localhost/api/v1/recent_viewed -v -u #{login}:#{password} -H "Conten =end def index - recent_viewed = RecentView.list_fulldata( current_user, 10 ) + recent_viewed = RecentView.list_full( current_user, 10 ) # return result render :json => recent_viewed diff --git a/app/controllers/sessions/collection_base.rb b/app/controllers/sessions/collection_base.rb index cb594407f..b86756a83 100644 --- a/app/controllers/sessions/collection_base.rb +++ b/app/controllers/sessions/collection_base.rb @@ -13,6 +13,9 @@ module ExtraCollection collections[ OnlineNotification.to_app_model ] = OnlineNotification.list(user, 20) assets = ApplicationModel.assets_of_object_list(collections[ OnlineNotification.to_app_model ], assets) + collections[ RecentView.to_app_model ] = RecentView.list(user, 10) + assets = RecentView.assets_of_object_list(collections[ RecentView.to_app_model ], assets) + collections[ Role.to_app_model ] = [] Role.all.each {|item| assets = item.assets(assets) diff --git a/app/models/recent_view.rb b/app/models/recent_view.rb index 3eef8087b..e670d6f4b 100644 --- a/app/models/recent_view.rb +++ b/app/models/recent_view.rb @@ -46,20 +46,20 @@ class RecentView < ApplicationModel list end - def self.list_fulldata( user, limit = 10 ) + def self.list_full( user, limit = 10 ) recent_viewed = self.list( user, limit ) # get related object assets = ApplicationModel.assets_of_object_list(recent_viewed) return { - :recent_viewed => recent_viewed, - :assets => assets, + :stream => recent_viewed, + :assets => assets, } end def notify_clients - data = RecentView.list_fulldata( User.find(self.created_by_id), 10 ) + data = RecentView.list_full( User.find(self.created_by_id), 10 ) Sessions.send_to( self.created_by_id, {