From 37f448e05e411cb07e829a0d93f6a83ee95ccdf3 Mon Sep 17 00:00:00 2001 From: Nick Sutterer Date: Tue, 3 May 2011 23:38:44 +0200 Subject: added :prefixes accessor to LookupContext. --- actionpack/lib/action_view/lookup_context.rb | 2 ++ actionpack/test/template/lookup_context_test.rb | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb index 06c607931d..89729b70b3 100644 --- a/actionpack/lib/action_view/lookup_context.rb +++ b/actionpack/lib/action_view/lookup_context.rb @@ -9,6 +9,8 @@ module ActionView # generate a key, given to view paths, used in the resolver cache lookup. Since # this key is generated just once during the request, it speeds up all cache accesses. class LookupContext #:nodoc: + attr_accessor :prefixes + mattr_accessor :fallbacks @@fallbacks = FallbackFileSystemResolver.instances diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index ff94cba59f..82ca7ba173 100644 --- a/actionpack/test/template/lookup_context_test.rb +++ b/actionpack/test/template/lookup_context_test.rb @@ -180,6 +180,12 @@ class LookupContextTest < ActiveSupport::TestCase assert_not_equal template, old_template end + + test "responds to #prefixes" do + assert_equal nil, @lookup_context.prefixes + @lookup_context.prefixes = ["foo"] + assert_equal ["foo"], @lookup_context.prefixes + end end class LookupContextWithFalseCaching < ActiveSupport::TestCase -- cgit v1.2.3