From 0bbc3659d66557aefd24b77d66772cdff666479a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 22 Jan 2021 17:00:03 +0100 Subject: [PATCH] Style --- lib/jbuilder.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/jbuilder.rb b/lib/jbuilder.rb index defd55e..43b2536 100644 --- a/lib/jbuilder.rb +++ b/lib/jbuilder.rb @@ -242,14 +242,8 @@ def attributes! end # Merges hash, array, or Jbuilder instance into current builder. - def merge!(obj) - hash_or_array = - if ::Jbuilder === obj - obj.attributes! - else - obj - end - + def merge!(object) + hash_or_array = ::Jbuilder === object ? object.attributes! : object @attributes = _merge_values(@attributes, hash_or_array) end