mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge _details_defaults and details_for_render
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,10 +27,6 @@ module ActionController
|
||||
super
|
||||
end
|
||||
|
||||
def details_for_render
|
||||
{:formats => formats}
|
||||
end
|
||||
|
||||
def format_for_text
|
||||
formats.first
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user