Wouldn't this break if what's passed in can't be mapped to an array? Maybe it would be better to make it elsif local_attributes.is_a?(Array)?