Ensure mailer view path is loaded when it's assigned. Path#[] raises if it isn't loaded.
This commit is contained in:
parent
ad4553587e
commit
909a7f430b
|
@ -427,7 +427,7 @@ module ActionMailer #:nodoc:
|
|||
|
||||
def template_root=(root)
|
||||
root = ActionView::PathSet::Path.new(root) if root.is_a?(String)
|
||||
write_inheritable_attribute(:template_root, root)
|
||||
write_inheritable_attribute(:template_root, root.load)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ module ActionView #:nodoc:
|
|||
end
|
||||
|
||||
def [](path)
|
||||
raise "Unloaded view path! #{@path}" unless @loaded
|
||||
@paths[path]
|
||||
end
|
||||
|
||||
|
@ -51,6 +52,7 @@ module ActionView #:nodoc:
|
|||
|
||||
def load
|
||||
reload! unless loaded?
|
||||
self
|
||||
end
|
||||
|
||||
# Rebuild load path directory cache
|
||||
|
|
Loading…
Reference in New Issue