fix ordering for logged out users
This commit is contained in:
parent
3d48dc4fb0
commit
d80afc64ec
1 changed files with 2 additions and 2 deletions
|
|
@ -72,11 +72,11 @@ class Post < ActiveRecord::Base
|
|||
}
|
||||
|
||||
def self.next(post)
|
||||
where("posts.created_at > ?", post.created_at).order('posts.created_at ASC').last
|
||||
where("posts.created_at > ?", post.created_at).order('posts.created_at ASC').first
|
||||
end
|
||||
|
||||
def self.previous(post)
|
||||
where("posts.created_at < ?", post.created_at).first
|
||||
where("posts.created_at < ?", post.created_at).order('posts.created_at DESC').first
|
||||
end
|
||||
|
||||
def self.visible_from_author(author, current_user=nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue