Sha256: 2895d0956e4b1442889206986cd84eb8f0e257d433f8a3396f766b11dd177b56
Contents?: true
Size: 483 Bytes
Versions: 29
Compression:
Stored size: 483 Bytes
Contents
# frozen_string_literal: true module PagesCore module PageModel module Autopublishable extend ActiveSupport::Concern included do before_validation :set_autopublish after_save :queue_autopublisher end private def set_autopublish self.autopublish = published_at? && published_at > Time.now.utc true end def queue_autopublisher Autopublisher.queue! if autopublish? end end end end
Version data entries
29 entries across 29 versions & 1 rubygems