mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 13:51:26 +00:00
Remove inefficient scope
This commit is contained in:
parent
e208709eef
commit
734ab0da54
1 changed files with 0 additions and 4 deletions
|
@ -32,10 +32,6 @@ class Topic < ActiveRecord::Base
|
||||||
|
|
||||||
scope :basic, :include => [:latest, { forum: :forumer }, :user]
|
scope :basic, :include => [:latest, { forum: :forumer }, :user]
|
||||||
scope :ordered, :order => "state DESC, posts.id DESC"
|
scope :ordered, :order => "state DESC, posts.id DESC"
|
||||||
scope :recent,
|
|
||||||
:conditions => "forumers.id IS NULL AND posts.id = (SELECT id FROM posts AS P WHERE P.topic_id = topics.id ORDER BY id DESC LIMIT 1)",
|
|
||||||
:order => "posts.id DESC",
|
|
||||||
:group => "topics.id"
|
|
||||||
scope :latest_page,
|
scope :latest_page,
|
||||||
lambda { |page| {:limit => "#{(page-1)*LATEST_PER_PAGE}, #{(page-1)*LATEST_PER_PAGE+LATEST_PER_PAGE}"} }
|
lambda { |page| {:limit => "#{(page-1)*LATEST_PER_PAGE}, #{(page-1)*LATEST_PER_PAGE+LATEST_PER_PAGE}"} }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue