Ensure ActionView::PathSet::Path is not initialized with a precompiled path

This commit is contained in:
Joshua Peek
2008-07-19 15:27:55 -05:00
parent 1b4b1aa725
commit 55bfe6be52
2 changed files with 4 additions and 1 deletions

View File

@@ -426,7 +426,8 @@ module ActionMailer #:nodoc:
end
def template_root=(root)
write_inheritable_attribute(:template_root, ActionView::PathSet::Path.new(root))
root = ActionView::PathSet::Path.new(root) if root.is_a?(String)
write_inheritable_attribute(:template_root, root)
end
end

View File

@@ -28,6 +28,8 @@ module ActionView #:nodoc:
delegate :to_s, :to_str, :inspect, :to => :path
def initialize(path)
raise ArgumentError, "path already is a Path class" if path.is_a?(Path)
@path = path.freeze
reload!
end