TopicQuery cleanup in advance of custom sorting:

- Move SQL method constants into a module
- Removed unused count methods
- Moved methods that don't return a TopicList into Topic
- Replaced some confusing method signatures
This commit is contained in:
Robin Ward
2013-11-13 12:26:32 -05:00
parent df568df9dc
commit 7207cef7aa
5 changed files with 97 additions and 99 deletions

View File

@ -274,8 +274,8 @@ class ApplicationController < ActionController::Base
end
def build_not_found_page(status=404, layout=false)
@top_viewed = TopicQuery.top_viewed(10)
@recent = TopicQuery.recent(10)
@top_viewed = Topic.top_viewed(10)
@recent = Topic.recent(10)
@slug = params[:slug].class == String ? params[:slug] : ''
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
@slug.gsub!('-',' ')