virtus icon indicating copy to clipboard operation
virtus copied to clipboard

silence "warning: method redefined; discarding old attribute"

Open krisleech opened this issue 10 years ago • 1 comments

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.

krisleech avatar Feb 12 '15 10:02 krisleech

Thanks, when does this happen?

solnic avatar Feb 16 '15 19:02 solnic