mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix some accidental nils
This commit is contained in:
parent
3726080ece
commit
03e9a6417d
2 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ module ActionView
|
|||
Accessors.send :define_method, :"default_#{name}", &block
|
||||
Accessors.module_eval <<-METHOD, __FILE__, __LINE__ + 1
|
||||
def #{name}
|
||||
@details[:#{name}]
|
||||
@details.fetch(:#{name}, [])
|
||||
end
|
||||
|
||||
def #{name}=(value)
|
||||
|
|
|
@ -18,10 +18,10 @@ module ActionView
|
|||
|
||||
# Determine the template to be rendered using the given options.
|
||||
def determine_template(options) #:nodoc:
|
||||
keys = options[:locals].try(:keys) || []
|
||||
keys = options.fetch(:locals, {}).keys
|
||||
|
||||
if options.key?(:text)
|
||||
Template::Text.new(options[:text], formats.try(:first))
|
||||
Template::Text.new(options[:text], formats.first)
|
||||
elsif options.key?(:file)
|
||||
with_fallbacks { find_template(options[:file], nil, false, keys, @details) }
|
||||
elsif options.key?(:inline)
|
||||
|
|
Loading…
Reference in a new issue