diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-25 20:09:33 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-25 20:09:33 +0000 |
commit | db4781d0686020719a78454ab05152d22883a434 (patch) | |
tree | 1d7e3fcb106b470fcbf6bfe8d06fad6e4d71b33a /app | |
parent | 4fa51992b5bfe777601e1fb30e0ea3941f392212 (diff) | |
download | redmine-db4781d0686020719a78454ab05152d22883a434.tar.gz redmine-db4781d0686020719a78454ab05152d22883a434.zip |
Replaced hard-coded urls in Mailer#attachments_add
git-svn-id: http://redmine.rubyforge.org/svn/trunk@664 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/mailer.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 447feb0d5..6bb71b250 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -69,17 +69,17 @@ class Mailer < ActionMailer::Base def attachments_add(attachments) set_language_if_valid(Setting.default_language) container = attachments.first.container - url = "http://#{Setting.host_name}/" - added_to = "" - case container.class.to_s + url = '' + added_to = '' + case container.class.name when 'Version' - url << "projects/list_files/#{container.project_id}" + url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id) added_to = "#{l(:label_version)}: #{container.name}" when 'Document' - url << "documents/show/#{container.id}" + url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id) added_to = "#{l(:label_document)}: #{container.title}" when 'Issue' - url << "issues/show/#{container.id}" + url = url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => container.id) added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}" end @recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact |