Skip to content

Commit 214841e

Browse files
committed
Fix typed override Hash defaults
The new merge options was not doing the correct thing when calling `merge!` on `result`, since the result is now created as an indifferent access hash, which doesn't seem to implement the block callback for `merge!`. This was causing the default `"activesupport" => "false"` setting to be lost. Instead we create a normal Hash and then convert it to an indifferent access hash instead.
1 parent 39dd40f commit 214841e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/tapioca/helpers/config_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def config_options(options)
6868
.returns(Thor::CoreExt::HashWithIndifferentAccess)
6969
end
7070
def merge_options(*options)
71-
options.each_with_object(Thor::CoreExt::HashWithIndifferentAccess.new) do |option, result|
71+
merged = options.each_with_object({}) do |option, result|
7272
result.merge!(option || {}) do |_, this_val, other_val|
7373
if this_val.is_a?(Hash) && other_val.is_a?(Hash)
7474
Thor::CoreExt::HashWithIndifferentAccess.new(this_val.merge(other_val))
@@ -77,6 +77,8 @@ def merge_options(*options)
7777
end
7878
end
7979
end
80+
81+
Thor::CoreExt::HashWithIndifferentAccess.new(merged)
8082
end
8183
end
8284
end

0 commit comments

Comments
 (0)