shoulda-matchers v4.1.0 Release Notes
Release Date: 2019-07-16 // almost 5 years ago-
๐ Bug fixes
Fix
validate_uniqueness_of
so that it works when a scope is defined as a string instead of a symbol on the model. (#1176)Fix
have_db_index
so that it can be used against multiple models that are connected to different databases. (#1200)
๐ Features
โ Add support for Rails 6. No new Rails 6 features are supported, but only existing features that broke with the upgrade. (#1193)
โ Add support for expression indexes (Rails 5, Postgres only) to
have_db_index
. (#1211)Add
allow_nil
to thevalidate_presence_of
matcher. (834d8d0, #1100)
๐ Improvements
Update
validate_presence_of
so that if it is being used against an association which isrequired: true
oroptional: false
, or it is not configured as such but ActiveRecord defaultsbelong_to
associations tooptional: false
, and the matcher fails, the developer is reminded in the failure message that thebelong_to
matcher can be used instead. (#1214, 8697b01)Update
define_enum_for
so that it produces a more helpful message on failure. (#1216)