Skip to content
Extraits de code Groupes Projets
Valider d80afc64 rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

fix ordering for logged out users

parent 3d48dc4f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -72,11 +72,11 @@ class Post < ActiveRecord::Base ...@@ -72,11 +72,11 @@ class Post < ActiveRecord::Base
} }
def self.next(post) 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 end
def self.previous(post) 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 end
def self.visible_from_author(author, current_user=nil) def self.visible_from_author(author, current_user=nil)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter