-
Notifications
You must be signed in to change notification settings - Fork 69
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
Features aren't declared until Feature model has been required. #1
Comments
I've run into this problem too, since renaming the accessor class to Flip but leaving the model class as Feature. It makes me think that declaring the features inside the I'm thinking of moving the declarations into an initializer, or a config file loaded by an initializer. I guess in the mean time it's possible to create a |
That's what I was thinking but then you'd need to reload the server on new features correct? That's not that big an issue. There wouldn't be an issue with getting the current declaration back with an initializer would there, it could still be changed and the strategy could be changed on the fly right? |
Do you reckon this is a real pain point or have you guys found reasonable workarounds? I'm just trolling your project while I figure out how much work it would be to have it support other ORMs and send a PR. O/T but do you think this could also be used to facilitate A/B testing (like a strategy that gives users a 50% chance of seeing a feature; maybe even based on something like the last octet of the IP address being odd or even). |
The |
Only tested in development, but until the Feature model has been loaded, any call to a
Flip.on? :blarg
will raiseNo feature declared with key :blarg
.If you simply place
require 'feature'
before a call, then the problem will go away (even for subsequent requests AFTER removing therequire 'feature'
line).Is it easy enough to include a load method in Flip, which checks for initialization and requires 'feature' if it's not available?
The text was updated successfully, but these errors were encountered: