Ruby: merge nested hash March 6, 2023 by Tarik For rails 3.0.0+ or higher version there is the deep_merge function for ActiveSupport that does exactly what you ask for.