Skip to content

Commit

Permalink
Set entries with future date to now.
Browse files Browse the repository at this point in the history
  • Loading branch information
benubois committed Aug 22, 2016
1 parent 1d1a2c3 commit d53d24e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/entry.rb
Expand Up @@ -137,8 +137,9 @@ def is_fully_qualified(url_string)
end

def ensure_published
if self.published.nil? || self.published > 1.day.from_now
self.published = DateTime.now
now = DateTime.now
if self.published.nil? || self.published > now
self.published = now
end
true
end
Expand Down

0 comments on commit d53d24e

Please sign in to comment.