aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/base/layout.rb9
-rw-r--r--actionpack/lib/action_controller/base/render.rb2
-rw-r--r--actionpack/lib/action_view/template/renderable.rb2
-rw-r--r--actionpack/test/controller/mime_responds_test.rb4
-rw-r--r--activesupport/lib/active_support/concurrent_hash.rb1
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb3
-rw-r--r--activesupport/lib/active_support/testing/pending.rb2
-rw-r--r--activesupport/test/memoizable_test.rb2
8 files changed, 15 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/base/layout.rb b/actionpack/lib/action_controller/base/layout.rb
index 88a15aa6ca..4fcef6c5d9 100644
--- a/actionpack/lib/action_controller/base/layout.rb
+++ b/actionpack/lib/action_controller/base/layout.rb
@@ -174,7 +174,9 @@ module ActionController #:nodoc:
end
def default_layout(*args)
- (@_memoized_default_layout ||= ::ActiveSupport::ConcurrentHash.new)[args] ||= memoized_default_layout(*args)
+ memoized_default_layout(*args)
+ @_memoized_default_layout ||= ::ActiveSupport::ConcurrentHash.new
+ @_memoized_default_layout[args] ||= memoized_default_layout(*args)
end
def memoized_find_layout(layout, formats) #:nodoc:
@@ -184,7 +186,8 @@ module ActionController #:nodoc:
end
def find_layout(*args)
- (@_memoized_find_layout ||= ::ActiveSupport::ConcurrentHash.new)[args] ||= memoized_find_layout(*args)
+ @_memoized_find_layout ||= ::ActiveSupport::ConcurrentHash.new
+ @_memoized_find_layout[args] ||= memoized_find_layout(*args)
end
def layout_list #:nodoc:
@@ -222,7 +225,7 @@ module ActionController #:nodoc:
self.class.find_layout(layout_name, formats)
end
- def _pick_layout(layout_name, implicit = false)
+ def _pick_layout(layout_name = nil, implicit = false)
return unless layout_name || implicit
layout_name = true if layout_name.nil?
active_layout(layout_name) if action_has_layout? && layout_name
diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb
index c4a3725079..0d24f18633 100644
--- a/actionpack/lib/action_controller/base/render.rb
+++ b/actionpack/lib/action_controller/base/render.rb
@@ -370,7 +370,7 @@ module ActionController
end
def render_for_parts(parts, layout, options = {})
- tmp = view_paths.find_by_parts(*parts)
+ tmp = view_paths.find_by_parts(*parts)
layout = _pick_layout(*layout) unless tmp.exempt_from_layout?
diff --git a/actionpack/lib/action_view/template/renderable.rb b/actionpack/lib/action_view/template/renderable.rb
index 0e8e0c4a38..2da5b742aa 100644
--- a/actionpack/lib/action_view/template/renderable.rb
+++ b/actionpack/lib/action_view/template/renderable.rb
@@ -64,7 +64,7 @@ module ActionView
end_src
begin
- ActionView::Base::CompiledTemplates.module_eval(source, filename, 0)
+ ActionView::Base::CompiledTemplates.module_eval(source, filename.to_s, 0)
rescue Exception => e # errors from template code
if logger = defined?(ActionController) && Base.logger
logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb
index 1c81989d9b..7cd5145a2f 100644
--- a/actionpack/test/controller/mime_responds_test.rb
+++ b/actionpack/test/controller/mime_responds_test.rb
@@ -444,10 +444,10 @@ class MimeControllerTest < ActionController::TestCase
end
get :using_defaults
- assert_equal "using_defaults - html", @response.body
+ assert_equal "using_defaults - #{[:html].to_s}", @response.body
get :using_defaults, :format => "xml"
- assert_equal "using_defaults - xml", @response.body
+ assert_equal "using_defaults - #{[:xml].to_s}", @response.body
end
def test_format_with_custom_response_type
diff --git a/activesupport/lib/active_support/concurrent_hash.rb b/activesupport/lib/active_support/concurrent_hash.rb
index c9f9b16da3..40224765a7 100644
--- a/activesupport/lib/active_support/concurrent_hash.rb
+++ b/activesupport/lib/active_support/concurrent_hash.rb
@@ -9,6 +9,7 @@ module ActiveSupport
def []=(k,v)
@mutex.synchronize { @backup_cache[k] = v }
@frozen_cache = @backup_cache.dup.freeze
+ v
end
def [](k)
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index b93057fe27..2ac5339f07 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -368,7 +368,8 @@ module ActiveSupport
end
RUBY_EVAL
- class_eval str, __FILE__, __LINE__ + 1
+ undef_method "_run_#{symbol}_callbacks" if method_defined?("_run_#{symbol}_callbacks")
+ class_eval str, __FILE__, __LINE__
before_name, around_name, after_name =
options.values_at(:before, :after, :around)
diff --git a/activesupport/lib/active_support/testing/pending.rb b/activesupport/lib/active_support/testing/pending.rb
index b6905ddccd..d945c7e476 100644
--- a/activesupport/lib/active_support/testing/pending.rb
+++ b/activesupport/lib/active_support/testing/pending.rb
@@ -16,7 +16,7 @@ module ActiveSupport
begin
block.call
- rescue
+ rescue Exception
failed = true
end
diff --git a/activesupport/test/memoizable_test.rb b/activesupport/test/memoizable_test.rb
index b03178900f..214e243aa5 100644
--- a/activesupport/test/memoizable_test.rb
+++ b/activesupport/test/memoizable_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class MemoizableTest < Test::Unit::TestCase
+class MemoizableTest < ActiveSupport::TestCase
class Person
extend ActiveSupport::Memoizable