Skip to content
Snippets Groups Projects
Commit 9103dc79 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Fix #411

parent 7df64321
No related branches found
No related tags found
No related merge requests found
...@@ -96,7 +96,7 @@ class Communication::Website::Post < ApplicationRecord ...@@ -96,7 +96,7 @@ class Communication::Website::Post < ApplicationRecord
} }
def published? def published?
published && published_at&.to_date <= Date.today published && published_at && published_at.to_date <= Date.today
end end
# Is it used? # Is it used?
...@@ -152,7 +152,7 @@ class Communication::Website::Post < ApplicationRecord ...@@ -152,7 +152,7 @@ class Communication::Website::Post < ApplicationRecord
end end
def set_published_at def set_published_at
self.published_at = Time.zone.now if published? && published_at.nil? self.published_at = Time.zone.now if published && published_at.nil?
end end
def explicit_blob_ids def explicit_blob_ids
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment