-
-
Notifications
You must be signed in to change notification settings - Fork 912
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
Record uniqueness matcher fails with STI when type column is enum #1635
Comments
Hi, thanks for the report! Unfortunately, we can't do much in that case, as the defined values are only stored in the database. I searched for an interface to access those values in the Rails adapters, but it does not exist (so it could work for any database adapter); it might be something nice to add on Rails itself. If I have some free time, I can try to move that forward in Rails, but I can't promise as I don't have much time now. |
Would it work to add a manual override in the matcher API? Something like |
Yes, that's an excellent idea. I'll put that on my backlog of features! |
Thanks so much! |
Description
The
succ
call described in #854 fails to match when thetype
column being used in STI is an enumerable, because that column's values are restricted.Reproduction Steps
Modify the below reproduction script to match a locally running Postgres install, and then run it.
Expected behavior
Validation passes.
Actual behavior
System configuration
shoulda_matchers version: 6.2.0
rails version: 7.1.3.2
ruby version: 3.2.1
The text was updated successfully, but these errors were encountered: