virtus
virtus copied to clipboard
silence "warning: method redefined; discarding old attribute"
virtus/lib/virtus/builder.rb:73: warning: method redefined; discarding old attribute
virtus/lib/virtus/builder/hook_context.rb:43: warning: previous definition of attribute was here
This PR silences the above warning by first undefining the method before defining a new one.
I do not know if this is a good tactic. I assume the defined singleton method can not call super anyway, otherwise there would be no warning.
Thanks, when does this happen?