Skip to content

Commit

Permalink
Don't mutate {options} in unnest
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshjain999 committed Jan 20, 2023
1 parent 1fd960d commit 7732de3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/disposable/twin/property/unnest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module Disposable::Twin::Property
module Unnest
# TODO: test that nested properties options are "unnested", too, e.g. populator.

def unnest(name, options)
from = options.delete(:from)
# needed to make reform process this field.

def unnest(name, from:, **options)
options = definitions.get(from)[:nested].definitions.get(name).instance_variable_get(:@options) # FIXME.
options = options.merge(virtual: true, _inherited: true, private_name: nil)

Expand Down

0 comments on commit 7732de3

Please sign in to comment.