aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-01 15:03:51 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-03-01 17:45:37 -0800
commit300d6b549d020cbfaa10657f07a22ec892d8078f (patch)
treed84c72e6d4c928fe38448b8050abbf80f11e567e
parent8b5b2413772e05bde96591570c4a105a53b611a2 (diff)
downloadrails-300d6b549d020cbfaa10657f07a22ec892d8078f.tar.gz
rails-300d6b549d020cbfaa10657f07a22ec892d8078f.tar.bz2
rails-300d6b549d020cbfaa10657f07a22ec892d8078f.zip
Merge _details_defaults and details_for_render
-rw-r--r--actionpack/lib/abstract_controller/details_cache.rb2
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb4
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb4
3 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/abstract_controller/details_cache.rb b/actionpack/lib/abstract_controller/details_cache.rb
index 5b87b41e7d..be1a1c0f34 100644
--- a/actionpack/lib/abstract_controller/details_cache.rb
+++ b/actionpack/lib/abstract_controller/details_cache.rb
@@ -34,7 +34,7 @@ module AbstractController
end
def render_to_body(*args)
- Thread.current[:format_locale_key] = HashKey.get(self.class, _details_defaults)
+ Thread.current[:format_locale_key] = HashKey.get(self.class, details_for_render)
super
end
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index 32fdf821a7..2ea4f02871 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -168,12 +168,12 @@ module AbstractController
end
end
- def _details_defaults
+ def details_for_render
{ :formats => formats, :locale => [I18n.locale] }
end
def _normalize_details(options)
- details = _details_defaults
+ details = details_for_render
details[:formats] = Array(options[:format]) if options[:format]
details[:locale] = Array(options[:locale]) if options[:locale]
details
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index 6e5379745b..00a09309bf 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -27,10 +27,6 @@ module ActionController
super
end
- def details_for_render
- {:formats => formats}
- end
-
def format_for_text
formats.first
end