xml_helper.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:1k
- 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