Sha256: b0cde6102849530668f3e075223d289425f70a9e2946b65aaf29fa8f6885c00c

Contents?: true

Size: 515 Bytes

Versions: 10

Compression:

Stored size: 515 Bytes

Contents

module XmlHelper
  def pub_date(time)
    time.rfc822
  end
  
  def collection_lastmod(collection)
    article_updated = collection.articles.find(:first, :order => 'updated_at DESC')
    article_published = collection.articles.find(:first, :order => 'published_at DESC')

    times = []
    times.push article_updated.updated_at if article_updated
    times.push article_published.updated_at if article_published

    if times.empty?
      Time.at(0).xmlschema
    else
      times.max.xmlschema
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
typo-5.5 app/helpers/xml_helper.rb
typo-5.4.4 app/helpers/xml_helper.rb
typo-5.4.3 app/helpers/xml_helper.rb
typo-5.4.2 app/helpers/xml_helper.rb
typo-5.4.1 app/helpers/xml_helper.rb
typo-5.4 app/helpers/xml_helper.rb
typo-5.1.98 app/helpers/xml_helper.rb
typo-5.2.98 app/helpers/xml_helper.rb
typo-5.2 app/helpers/xml_helper.rb
typo-5.3 app/helpers/xml_helper.rb