You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something in this project is causing rails model classes to become subclasses of themselves during runtime. Even just loading the motor admin list page for a model was wreaking havoc in our system.
This is a really weird one and the only thing I have to prove it is a (somewhat) bug that it surfaced in rolify. The model in question was using resourcify and generating bad queries after simply loading the list page for the model in motor admin.
I initially thought this might be a bug in the rails class dependency tracking, however the issue persisted after upgrading to rails 7.1 and ruby 3.1 where they use the new ruby builtin Class.subclasses instead of their own tracking.
For now, I've had to remove motor admin from our project.
The text was updated successfully, but these errors were encountered:
Something in this project is causing rails model classes to become subclasses of themselves during runtime. Even just loading the motor admin list page for a model was wreaking havoc in our system.
This is a really weird one and the only thing I have to prove it is a (somewhat) bug that it surfaced in rolify. The model in question was using
resourcify
and generating bad queries after simply loading the list page for the model in motor admin.The bad queries were coming from here https://github.com/RolifyCommunity/rolify/blob/master/lib/rolify/adapters/active_record/resource_adapter.rb#L13-L26 because
klasses
had the same class multiple times (ie.['Organization', 'Organization']
) and the only way I can see that can happen is if a class is a subclass of itself (see https://github.com/RolifyCommunity/rolify/blob/master/lib/rolify/adapters/base.rb#L27-L29).I initially thought this might be a bug in the rails class dependency tracking, however the issue persisted after upgrading to rails 7.1 and ruby 3.1 where they use the new ruby builtin
Class.subclasses
instead of their own tracking.For now, I've had to remove motor admin from our project.
The text was updated successfully, but these errors were encountered: