Sha256: a50dff50c41ae72f06f852a19c16b0a71bfbeeea597bbb64eae352bc98e43bb0
Contents?: true
Size: 657 Bytes
Versions: 2
Compression:
Stored size: 657 Bytes
Contents
module ContentState class Draft < Base include Singleton def enter_hook(content) super content[:published] = false content[:published_at] = nil end def change_published_state(content, boolean) content[:published] = boolean if boolean content.state = JustPublished.instance end end def set_published_at(content, new_time) content[:published_at] = new_time return if new_time.nil? if new_time <= Time.now content[:published_at] = nil else content.state = PublicationPending.instance end end def draft? true end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
typo-4.1.1 | app/models/content_state/draft.rb |
typo-4.1 | app/models/content_state/draft.rb |