We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d517a27 commit 32e1508Copy full SHA for 32e1508
lib/recursive_open_struct.rb
@@ -170,7 +170,11 @@ def delete_field(name)
170
171
unless OpenStruct.public_instance_methods.include?(:initialize_copy)
172
def initialize_dup(orig)
173
- initialize(orig.to_hash, orig.instance_variable_get(:@options))
+ super
174
+ # deep copy the table to separate the two objects
175
+ @table = @deep_dup.call(@table)
176
+ # Forget any memoized sub-elements
177
+ @sub_elements = {}
178
end
179
180
0 commit comments