Module: Publishable

Extended by:
ActiveSupport::Concern
Included in:
Page, Post
Defined in:
app/models/concerns/publishable.rb

Overview

Adds support for publishing a model

Model must have published_at field

Instance Method Summary collapse

Instance Method Details

#draft?Boolean


13
14
15
# File 'app/models/concerns/publishable.rb', line 13

def draft?
  published_at.nil?
end

#published?Boolean


9
10
11
# File 'app/models/concerns/publishable.rb', line 9

def published?
  published_at.present?
end