-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Throw `Feature::Subject::NotApplicable` when an invalid subject is specified. This allows for better differentiation of error cases. Given a feature specified as: ```yaml user: id: 1 ``` and a feature check like `Feature.enabled?(:check, user_id: 1)` then when the feature was modified to include *additional* constraints like ```yaml user: id: 1 age: gt: 3 ``` every caller would immediately fail with `Feature::Subject::Invalid`. In production this creates an intensely tight coupling between the caller and feature data source that is effectively impossible to safely modify. By allowing *partial subject checks* the coupling is removed, allowing for data source additions without active caller errors.
- Loading branch information
Showing
6 changed files
with
54 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ source 'https://rubygems.org' | |
gemspec | ||
|
||
group :test do | ||
gem "pry" | ||
gem "pry-byebug" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters