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

Remove the flatten on actors to prevent delegator warning. #882

Conversation

jfvanderwalt
Copy link

@jfvanderwalt jfvanderwalt commented Sep 11, 2024

Hi 👋 When using Flipper with actors that are ActiveRecord models, you get this warning whenever the application checks a feature flag:

...lib/flipper/feature.rb:103: warning: delegator does not forward private method #to_ary

There is a thread on the Rails Github issues explaining this particular issue, although this is not a big problem per se it does mean the Flipper gem generates unnecessary noise in application logs.

When the passing of multiple arguments was built in, the intent seems to have been to allow the users to pass arguments like:

Flipper.enabled?(:some_feature, [user, team, org])

In this case, the flatten does seem like it is not required and could be removed which eliminates the warning?

@jfvanderwalt jfvanderwalt force-pushed the fix-warning-forwarding-private-method branch from 9adf36d to ba84b60 Compare September 11, 2024 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant