Skip to content

Commit

Permalink
Remove :cache => true on lookup templates initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 14, 2010
1 parent aa508c9 commit 01ab6f9
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 53 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/lookup_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def initialize
def initialize(view_paths, details = {})
@details, @details_key = { :handlers => default_handlers }, nil
@frozen_formats, @skip_default_locale = false, false
@cache = details.key?(:cache) ? details.delete(:cache) : true
@cache = true

self.view_paths = view_paths
self.registered_detail_setters.each do |key, setter|
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/renderer/template_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def determine_template(options) #:nodoc:
with_fallbacks { find_template(options[:file], options[:prefix], false, keys) }
elsif options.key?(:inline)
handler = Template.handler_class_for_extension(options[:type] || "erb")
Template::Inline.new(options[:inline], handler, :locals => keys)
Template.new(options[:inline], "inline template", handler, :locals => keys)
elsif options.key?(:template)
options[:template].respond_to?(:render) ?
options[:template] : find_template(options[:template], options[:prefix], false, keys)
Expand Down
9 changes: 0 additions & 9 deletions actionpack/lib/action_view/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class Template
autoload :Error
autoload :Handler
autoload :Handlers
autoload :Inline
autoload :Text
end

Expand Down Expand Up @@ -185,14 +184,6 @@ def rerender(view)
end
end

def hash
identifier.hash
end

def eql?(other)
other.is_a?(Template) && other.identifier == identifier
end

def inspect
@inspect ||=
if defined?(Rails.root)
Expand Down
20 changes: 0 additions & 20 deletions actionpack/lib/action_view/template/inline.rb

This file was deleted.

11 changes: 1 addition & 10 deletions actionpack/test/controller/new_base/render_once_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,8 @@ def test_with_nil_prefix_option
end
end

class TestWithResolverCache < Rack::TestCase
class TestRenderOnce < Rack::TestCase
testing RenderTemplate::RenderOnceController
include Tests
end

class TestWithoutResolverCache < Rack::TestCase
testing RenderTemplate::RenderOnceController
include Tests

def setup
RenderTemplate::RenderOnceController::RESOLVER.stubs(:caching?).returns(false)
end
end
end
4 changes: 0 additions & 4 deletions actionpack/test/template/lookup_context_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ def teardown

assert_not_equal template, old_template
end

test "can have cache disabled on initialization" do
assert !ActionView::LookupContext.new(FIXTURE_LOAD_PATH, :cache => false).cache
end
end

class LookupContextWithFalseCaching < ActiveSupport::TestCase
Expand Down
8 changes: 0 additions & 8 deletions actionpack/test/template/template_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,6 @@ def test_rerender_raises_an_error_without_virtual_path
end
end

def test_inline_template_is_only_equal_if_source_match
inline1 = ActionView::Template::Inline.new("sample", ERBHandler)
inline2 = ActionView::Template::Inline.new("sample", ERBHandler)
inline3 = ActionView::Template::Inline.new("other", ERBHandler)
assert inline1.eql?(inline2)
assert !inline1.eql?(inline3)
end

if "ruby".encoding_aware?
def test_resulting_string_is_utf8
@template = new_template
Expand Down

0 comments on commit 01ab6f9

Please sign in to comment.