Merge _details_defaults and details_for_render

This commit is contained in:
Carlhuda
2010-03-01 15:03:51 -08:00
parent 8b5b241377
commit 300d6b549d
3 changed files with 3 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -27,10 +27,6 @@ module ActionController
super
end
def details_for_render
{:formats => formats}
end
def format_for_text
formats.first
end