Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
osbre authored Jun 26, 2024
1 parent 93a6830 commit 06ebce3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# StiFallback

Imagine you're getting a `type` column from your users. You want to validate that the type is one of the expected values instead of letting ActiveRecord raise an error when the subclass is not found.
Imagine you're using [STI](https://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html) and getting a `type` column from your users. You want to validate that the type is one of the expected values instead of letting ActiveRecord raise an error when the subclass is not found.

This can be achieved by using the falling back to the base and defining a validation for the `type` column.
This can be achieved by defining a validation rule on the base mode and falling back to it when the subclass is not found.

This gem provides a simple way to do that.

## Usage

Expand Down

0 comments on commit 06ebce3

Please sign in to comment.