Sha256: 690092bd95da977d25dd50960488e5f81148fc1cfcb7c4dd80a679296f81bf6f

Contents?: true

Size: 862 Bytes

Versions: 10

Compression:

Stored size: 862 Bytes

Contents

class DocumentedContent < Content
  has_permalink :title
  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

10 entries across 10 versions & 1 rubygems

Version Path
knitkit-2.0.11 app/models/documented_content.rb
knitkit-2.0.10 app/models/documented_content.rb
knitkit-2.0.9 app/models/documented_content.rb
knitkit-2.0.7 app/models/documented_content.rb
knitkit-2.0.6 app/models/documented_content.rb
knitkit-2.0.5 app/models/documented_content.rb
knitkit-2.0.4 app/models/documented_content.rb
knitkit-2.0.3 app/models/documented_content.rb
knitkit-2.0.2 app/models/documented_content.rb
knitkit-2.0.1 app/models/documented_content.rb