Sha256: 5f951c124c81974e589534f1163bec3773c8fcbbe254c0a57c34ad525a5d094e

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

class DocumentedContent < Content

  before_save :check_internal_identifier

  def to_param
    permalink
  end

  def check_internal_identifier
    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

6 entries across 6 versions & 1 rubygems

Version Path
knitkit-2.1.9 app/models/documented_content.rb
knitkit-2.1.8 app/models/documented_content.rb
knitkit-2.1.7 app/models/documented_content.rb
knitkit-2.1.6 app/models/documented_content.rb
knitkit-2.1.5 app/models/documented_content.rb
knitkit-2.1.4 app/models/documented_content.rb