From 5c9cbcd2280680c62df8916b34b4db012779ef26 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 2 Sep 2019 20:45:54 +0200 Subject: Don't allow navigating to posts with publish dates in the future. --- app/models/refinery/blog/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index cf0a526..b991962 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -127,7 +127,7 @@ module Refinery end def next(current_record) - where(["published_at > ? and draft = ?", current_record.published_at, false]).reorder('published_at ASC').with_globalize.first + where(["published_at > ? and published_at <= ? and draft = ?", current_record.published_at, Time::now, false]).reorder('published_at ASC').with_globalize.first end def published_before(date=Time.now) -- cgit v1.2.3