Module: LiveComponent::ViewComponentPatch::ClassMethodOverrides

Defined in:
ext/view_component_patch.rb

Instance Method Summary collapse

Instance Method Details

#new(*args, **kwargs, &block) ⇒ Object



12
13
14
15
16
17
18
19
# File 'ext/view_component_patch.rb', line 12

def new(*args, **kwargs, &block)
  return super unless kwargs[:actions] || kwargs[:targets]

  kwargs = ::LiveComponent::Utils.translate_attrs(Action, kwargs) if kwargs[:actions]
  kwargs = ::LiveComponent::Utils.translate_attrs(Target, kwargs) if kwargs[:targets]

  super
end