Closed thejchap closed 5 years ago
Will clean this up/get CI passing if/when we decide to add this feature
@thejchap Thank for taking the time to submit a PR but have you seen Rollout groups? (https://github.com/fetlife/rollout#groups)
If yes, how is the goal of this feature different from it?
@reneklacan unless I'm missing something, the gem currently assumes you only ever pass one type of model or object into active?
....the gem stores/looks up the user's ID to determine if a feature should be active for a user. So, there could potentially be collision issues if more than one type of object are passed in (ie the ID property isnt globally unique across all tables or whatever)
I guess the alternative without any code changes would be passing in id_user_by
with some other sort of ID that uses the class or table name or something (like users:1
), but then its just a bit messy that it's referred to as a user all throughout the gem even if it could be something else
Definitely open to other ideas/suggestions that would achieve the same goal
Hi, This PR adds support to evaluate whether a feature is active or not based on an arbitrary object/condition. Use case would be enabling a feature only on certain products, clients (multi tenant sites) or things like that.
For example
Open to other ways of implementing this if its a feature that would be useful to other people