diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index fa2038f78d85142f6c24524f06a53c819da7434a..9c50d946240bb1c7d846f76db7e33abdb6f41e0e 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -7,7 +7,7 @@ module ActionView # = Action View Resolver class Resolver # Keeps all information about view path and builds virtual path. - class Path < String + class Path attr_reader :name, :prefix, :partial, :virtual alias_method :partial?, :partial @@ -19,9 +19,16 @@ def self.build(name, prefix, partial) end def initialize(name, prefix, partial, virtual) - @name, @prefix, @partial = name, prefix, partial - super(virtual) + @name = name + @prefix = prefix + @partial = partial + @virtual = virtual end + + def to_str + @virtual + end + alias :to_s :to_str end cattr_accessor :caching diff --git a/actionpack/test/template/testing/null_resolver_test.rb b/actionpack/test/template/testing/null_resolver_test.rb index 535ad3ab148d0916e3d926ad9ce6567758067814..55ec36e753c4d9692192b8378b34423c2c05cc69 100644 --- a/actionpack/test/template/testing/null_resolver_test.rb +++ b/actionpack/test/template/testing/null_resolver_test.rb @@ -6,7 +6,7 @@ def test_should_return_template_for_any_path templates = resolver.find_all("path.erb", "arbitrary", false, {:locale => [], :formats => [:html], :handlers => []}) assert_equal 1, templates.size, "expected one template" assert_equal "Template generated by Null Resolver", templates.first.source - assert_equal "arbitrary/path.erb", templates.first.virtual_path + assert_equal "arbitrary/path.erb", templates.first.virtual_path.to_s assert_equal [:html], templates.first.formats end end