Sha256: 7bfddc6ae2a4a4b92f5a7e56c5a53ad012e6c00b89b3cfb1220298eb3730f80f

Contents?: true

Size: 840 Bytes

Versions: 4

Compression:

Stored size: 840 Bytes

Contents

class DocumentedContent < Content

  before_save :check_internal_indentifier

  def to_param
    permalink
  end

  def check_internal_indentifier
    self.internal_identifier = self.permalink if self.internal_identifier.blank?
  end
  
  def content_hash
    {:id => self.id, :title => self.title, :body_html => self.body_html}  
  end
  
  def self.find_published_by_section(active_publication, website_section)
    published_content = []
    documented_item = DocumentedItem.where(["online_document_section_id = ?", website_section.id]).first
    if documented_item
      documented_content = DocumentedContent.find(documented_item.documented_content_id)
      content = get_published_version(active_publication, documented_content)
      published_content << content unless content.nil?
    end

    published_content.first
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
knitkit-2.1.3 app/models/documented_content.rb
knitkit-2.1.2 app/models/documented_content.rb
knitkit-2.1.1 app/models/documented_content.rb
knitkit-2.1.0 app/models/documented_content.rb