我有兩個日記模型,ClientJournal
和InstitutionJournal
和我使用的太陽黑子運行哪個抓住記錄的查詢的期刊索引頁上同時顯示它們:如何訂購太陽黑子多種型號查詢的搜索結果?
search = Sunspot.search ClientJournal, InstitutionJournal do
paginate page: params[:page], per_page: 30
order_by :created_at, :desc
end
這幾乎工作,但它的結果分成命令他們前兩班,所以search.results
回報是這樣的:
created_at class
09:30 ClientJournal
09:12 ClientJournal
08:57 ClientJournal
07:32 ClientJournal
09:45 InstitutionJournal
09:22 InstitutionJournal
09:07 InstitutionJournal
當我真正想要的是這樣的:
created_at class
09:45 InstitutionJournal
09:30 ClientJournal
09:22 InstitutionJournal
09:12 ClientJournal
09:07 InstitutionJournal
08:57 ClientJournal
07:32 ClientJournal
是否有任何方法告訴太陽黑子將結果排列在一起,就好像它們是同一個模型一樣?
你有沒有想出解決辦法? – jmgem 2015-08-27 05:34:41