Atom feeds:

* prevent duplicate entry ids for issue changes
* prevent empty email in author element

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1154 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-02-16 16:20:35 +00:00
parent 0582337372
commit 153c4c242d
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ class Journal < ActiveRecord::Base
acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') }, acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') },
:description => :notes, :description => :notes,
:author => :user, :author => :user,
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id}} :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}}
def save def save
# Do not save an empty journal # Do not save an empty journal

View File

@ -15,8 +15,8 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.updated item.event_datetime.xmlschema xml.updated item.event_datetime.xmlschema
author = item.event_author if item.respond_to?(:author) author = item.event_author if item.respond_to?(:author)
xml.author do xml.author do
xml.name(author.is_a?(User) ? author.name : author) xml.name(author)
xml.email(author.mail) if author.is_a?(User) xml.email(author.mail) if author.respond_to?(:mail) && !author.mail.blank?
end if author end if author
xml.content "type" => "html" do xml.content "type" => "html" do
xml.text! textilizable(item.event_description) xml.text! textilizable(item.event_description)