Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix some accidental nils

  • Loading branch information...
commit 03e9a6417d52e2783a8a82e733f6e9ef000ece52 1 parent 3726080
Aaron Patterson tenderlove authored
2  actionpack/lib/action_view/lookup_context.rb
View
@@ -24,7 +24,7 @@ def self.register_detail(name, options = {}, &block)
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)
4 actionpack/lib/action_view/renderer/template_renderer.rb
View
@@ -18,10 +18,10 @@ def render(context, options)
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.