diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-06 20:08:27 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-06 20:11:21 -0500 |
commit | b2504f8ba0f9baadb9298647fd58ef2c136f9aae (patch) | |
tree | 205a73e5d381dc5e8c524d2858fe7f15d142e332 /actionpack/lib/action_view/base.rb | |
parent | ed8a882e47e07b470b71cacd8cd50e251dca4d27 (diff) | |
download | rails-b2504f8ba0f9baadb9298647fd58ef2c136f9aae.tar.gz rails-b2504f8ba0f9baadb9298647fd58ef2c136f9aae.tar.bz2 rails-b2504f8ba0f9baadb9298647fd58ef2c136f9aae.zip |
Tidy up ActionMailer rendering logic to take advantage of view path cache instead of using file system lookups
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index bdcb1dc246..ad59d92086 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -300,6 +300,8 @@ module ActionView #:nodoc: # # => 'users/legacy.rhtml' # def pick_template(template_path) + return template_path if template_path.respond_to?(:render) + path = template_path.sub(/^\//, '') if m = path.match(/(.*)\.(\w+)$/) template_file_name, template_file_extension = m[1], m[2] @@ -343,7 +345,8 @@ module ActionView #:nodoc: ActiveSupport::Deprecation.warn("use_full_path option has been deprecated and has no affect.", caller) end - if defined?(ActionMailer) && defined?(ActionMailer::Base) && controller.is_a?(ActionMailer::Base) && !template_path.include?("/") + if defined?(ActionMailer) && defined?(ActionMailer::Base) && controller.is_a?(ActionMailer::Base) && + template_path.is_a?(String) && !template_path.include?("/") raise ActionViewError, <<-END_ERROR Due to changes in ActionMailer, you need to provide the mailer_name along with the template name. |