Skip to content
New issue

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

classify is called on const arguments #168

Closed
aaronmallen opened this issue Feb 7, 2020 · 0 comments · Fixed by #174
Closed

classify is called on const arguments #168

aaronmallen opened this issue Feb 7, 2020 · 0 comments · Fixed by #174
Labels
bug Something isn't working verified This issue has been verified.
Milestone

Comments

@aaronmallen
Copy link
Owner

aaronmallen commented Feb 7, 2020

Current Behavior

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

  1. Create an interactor named PlaceData
  2. Create an organizer that organizes PlaceData
  3. inspect the organizer's organized interfaces
  4. 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.

see #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified This issue has been verified.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant