diff --git a/app/models/concerns/with_publication.rb b/app/models/concerns/with_publication.rb index 1d14fa8e379bf12cafa3496777981e825fc28e29..ae94dce5f572b66cb4f4ffd8b0047384bb9521bb 100644 --- a/app/models/concerns/with_publication.rb +++ b/app/models/concerns/with_publication.rb @@ -17,11 +17,11 @@ module WithPublication end def published_in_the_future? - published && published_at > Time.now + published && published_at.present? && published_at > Time.now end def published_now? - published && published_at <= Time.now + published && published_at.present? && published_at <= Time.now end protected diff --git a/test/fixtures/communication/website/pages.yml b/test/fixtures/communication/website/pages.yml index 716aca79a357f0083fda138799de8130464507f5..ee7005f6f70219cb67c287156605ede95bdb7d5e 100644 --- a/test/fixtures/communication/website/pages.yml +++ b/test/fixtures/communication/website/pages.yml @@ -53,6 +53,7 @@ page_root: language: fr position: 1 published: true + published_at: 2010-11-28 00:00:00 page_test: university: default_university @@ -62,6 +63,7 @@ page_test: language: fr position: 1 published: true + published_at: 2010-11-28 00:00:00 parent: page_root page_with_no_dependency: @@ -72,4 +74,5 @@ page_with_no_dependency: language: fr position: 2 published: true + published_at: 2010-11-28 00:00:00 parent: page_root