1

ドキュメントによると、エントリのupdated値は値Defaults to the updated_at attribute on the record if one such exists.を上書きしようとしていますupdatedが、代わりにupdatedRSSフィードに2つのフィールドがあります。

この(切り捨てられた)例で別の更新された値を設定した場合...

feed.entry(item) do |entry|
  entry.updated(item.not_the_updated_at_value.strftime("%Y-%m-%dT%H:%M:%SZ"))
end

...その後updated、RSSフィードに2つのフィールドが表示されます。

<entry>
    <id>1</id>
    <published>2010-03-30T13:11:07-07:00</published>
    <updated>2010-03-30T13:11:07-07:00</updated>
    <link rel="alternate" type="text/html" href="http://example.com/1"/>
    <title>Title</title>
    <content type="html">Content</content>
    <url>http://example.com/1/</url>
    <updated>2012-07-10T11:05:32Z</updated>
    <author>
      <name>Author</name>
    </author>
  </entry>
4

1 に答える 1

2

公開および更新されたオプションをエントリに渡す必要があります。

feed.entry(item, :published => item.published_at, 
                   :updated => item.published_at) do |entry|
  entry.content item.body, :type => 'html'
end
于 2013-01-28T22:42:25.003 に答える