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
When passing a Class or Module to ActiveInteractor::Organizer::Base.organize or ActiveInteractor::Base.contextualize_with the class name is mutated by String#classify.
Expected Behavior
When I pass a Class or Module to a method I expect the class or module to be returned correctly without mutation.
Steps to Reproduce
Create an interactor named PlaceData
Create an organizer that organizes PlaceData
inspect the organizer's organized interfaces
Notice PlaceData is missing from the collection.
Additional Comments
In the reproduction steps PlaceData is missing because classify forces the InteractorInterface to search for PlaceDatum. Calling classify on a passed const will convert the const to a string and then singularize that string. If a class or module is passed as an argument we should rely on NameError to protect us from invalid constants and not run any mutation on the passed class or module.
Current Behavior
When passing a Class or Module to
ActiveInteractor::Organizer::Base.organize
orActiveInteractor::Base.contextualize_with
the class name is mutated byString#classify
.Expected Behavior
When I pass a Class or Module to a method I expect the class or module to be returned correctly without mutation.
Steps to Reproduce
PlaceData
PlaceData
organized
interfacesPlaceData
is missing from the collection.Additional Comments
In the reproduction steps
PlaceData
is missing becauseclassify
forces theInteractorInterface
to search forPlaceDatum
. Callingclassify
on a passed const will convert the const to a string and then singularize that string. If a class or module is passed as an argument we should rely onNameError
to protect us from invalid constants and not run any mutation on the passed class or module.see #167
The text was updated successfully, but these errors were encountered: