phi_attrs
phi_attrs copied to clipboard
adding checks if the method is already defined
There is a possibility that if the active record is forked in the middle of initialization when under periods of high load that we define a wrapped method twice where the wrapped_method may be called with the relation = send(unwrapped_method, *args, **kwargs, &block) multiple times.
This change is mostly a prospective fix as it is nearly impossible to replicate not under load.