Sha256: 2871513c1e2acc1ebcbb3db4b719abb53457f228803513e600deb91c7594ef66

Contents?: true

Size: 483 Bytes

Versions: 24

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

module XmlHelper
  def collection_lastmod(collection)
    article_updated = collection.contents.order(updated_at: :desc).first
    article_published = collection.contents.order(published_at: :desc).first

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

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

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
publify_core-10.0.2 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.5.0 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.4.0 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.3.0 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.2.0 app/helpers/xml_helper.rb
publify_core-10.0.1 app/helpers/xml_helper.rb
publify_core-10.0.0 app/helpers/xml_helper.rb
publify_core-9.2.10 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.1.1 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.1.0 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.0.3 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.0.2 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.0.1 app/helpers/xml_helper.rb
HornsAndHooves-publify_core-10.0.0 app/helpers/xml_helper.rb
publify_core-9.2.9 app/helpers/xml_helper.rb
publify_core-9.2.8 app/helpers/xml_helper.rb
publify_core-9.2.7 app/helpers/xml_helper.rb
publify_core-9.2.6 app/helpers/xml_helper.rb
publify_core-9.2.5 app/helpers/xml_helper.rb
publify_core-9.2.4 app/helpers/xml_helper.rb