Module DraftUtils::InstanceMethods
In: app/models/draft_utils.rb

Methods

Public Instance methods

Garantiza que las noticias en borrador no tienen fecha de publicación. Se llama desde before_save

[Source]

    # File app/models/draft_utils.rb, line 5
 5:     def sync_draft_and_published_at
 6:       if self.draft?
 7:         self.published_at = nil
 8:       else
 9:         self.published_at = Time.zone.now if self.published_at.nil?
10:       end
11:     end

[Validate]