#3287 using reorder instead of order for newer, older
This commit is contained in:
parent
9c2c135731
commit
fe984eb426
1 changed files with 2 additions and 2 deletions
|
|
@ -42,11 +42,11 @@ class Post < ActiveRecord::Base
|
|||
}
|
||||
|
||||
def self.newer(post)
|
||||
where("posts.created_at > ?", post.created_at).order('posts.created_at ASC').first
|
||||
where("posts.created_at > ?", post.created_at).reorder('posts.created_at ASC').first
|
||||
end
|
||||
|
||||
def self.older(post)
|
||||
where("posts.created_at < ?", post.created_at).order('posts.created_at DESC').first
|
||||
where("posts.created_at < ?", post.created_at).reorder('posts.created_at DESC').first
|
||||
end
|
||||
|
||||
def self.visible_from_author(author, current_user=nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue