GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base_class? can be handy addition to the base_class which is the same as self == base_class.
In my project klass.base_class == klass is 50% the case of the base_class. The same is actual for AR internally.
self == base_class
klass.base_class == klass
(@rails-bot has picked a reviewer for you, use r? to override)
Add AR::Base.base_class? predicate
Is this a performance hot spot? Assuming the local variable is there for a reason 😅
I think not: the result of this method is cached inside @table_name and L512 with its string construction is way slower than the else case.