Slight changes to ease Rails 2.2 support.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2234 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-01-04 17:09:25 +00:00
parent 4a5d3e0353
commit 260373aed7
5 changed files with 48 additions and 11 deletions
+2 -2
View File
@@ -191,7 +191,7 @@ class Mailer < ActionMailer::Base
# URL options
h = Setting.host_name
h = h.to_s.gsub(%r{\/.*$}, '') unless ActionController::AbstractRequest.relative_url_root.blank?
h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank?
default_url_options[:host] = h
default_url_options[:protocol] = Setting.protocol
@@ -226,7 +226,7 @@ class Mailer < ActionMailer::Base
# Renders a message with the corresponding layout
def render_message(method_name, body)
layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
layout = method_name.to_s.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
body[:content_for_layout] = render(:file => method_name, :body => body)
ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
end