diff options
author | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 06:29:30 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 12:18:42 +0900 |
commit | 46d207fde47f7db810e7b1fcc1ba20094ec28824 (patch) | |
tree | 784606e60dc2460515673b9f9edd2f83340b498d | |
parent | a1d7d4c6dc5c4a7b8ef28f6408c3d91ca1cbae09 (diff) | |
download | rails-46d207fde47f7db810e7b1fcc1ba20094ec28824.tar.gz rails-46d207fde47f7db810e7b1fcc1ba20094ec28824.tar.bz2 rails-46d207fde47f7db810e7b1fcc1ba20094ec28824.zip |
Avoid creating new Array when looking up already registered detail
-rw-r--r-- | actionview/lib/action_view/lookup_context.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index 211fbc8e6c..f050d54e27 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -29,7 +29,7 @@ module ActionView Accessors.define_method(:"default_#{name}", &block) Accessors.module_eval <<-METHOD, __FILE__, __LINE__ + 1 def #{name} - @details.fetch(:#{name}, []) + @details[:#{name}] || [] end def #{name}=(value) |