Class: Postablr::Entry

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ArPublish
Defined in:
app/models/postablr/entry.rb

Defined Under Namespace

Classes: Audio, Image, Link, Post, Quote, Video

Instance Method Summary collapse

Methods included from ArPublish

#expired?, #fill_default_publish, #publish, #publish!, #publish_by_default, #published?, #unpublish, #unpublish!, #upcoming?, #validate_publish_date_consistency

Instance Method Details

#categories_listObject



21
22
23
# File 'app/models/postablr/entry.rb', line 21

def categories_list
  categories.map(&:name).join(", ")
end

#defaultsObject



25
26
27
28
# File 'app/models/postablr/entry.rb', line 25

def defaults
  return unless new_record?
  self.comments_enabled = true
end

#postable_nameObject



31
32
33
# File 'app/models/postablr/entry.rb', line 31

def postable_name
  postable.class.table_name.split("_")[2].singularize
end