Actions
Feature #22297
openModule#method_defined? should have an `include_private` argument
Feature #22297:
Module#method_defined? should have an `include_private` argument
Status:
Open
Assignee:
-
Target version:
-
Description
Active Record generate methods during boot time based on the database schema. However before defining every one of these methods it first check if it
already exists, regardless of visibility, as to avoid overwriting use defined code.
As a result, the following pattern is in a few hot spots:
On our Rails monolith, private_method_defined? account for 1% of boot time, that's not massive, but it could very easily be eliminated if there was a way to check for a method existence regardless of its visibility.
Proposal¶
Currently Module#method_defined? signature is:
I think we could make it:
No data to display
Actions