diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-09-02 20:45:54 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-09-02 20:45:54 +0200 |
commit | 5c9cbcd2280680c62df8916b34b4db012779ef26 (patch) | |
tree | 7d857f4c82c04ebd49bf436a0a2761e73adcbe39 | |
parent | f167ddee3d18d24d8c5d28cc4bbb6f46b19f9785 (diff) | |
download | refinerycms-blog-2-1-stable-for-hmno.tar.gz refinerycms-blog-2-1-stable-for-hmno.tar.bz2 refinerycms-blog-2-1-stable-for-hmno.zip |
Don't allow navigating to posts with publish dates in the future.2-1-stable-for-hmno
-rw-r--r-- | app/models/refinery/blog/post.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |