You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow uniqueness validations scoped by other fields on the model.
Additionally, allow case-insensitive uniqueness validations.
Usage:
classPost < Granite::Base
connection mysql
column id : Int64, primary:true
column title : String
column year : Int32
validate_uniqueness(
:title,
scope::year, # Scope can also accept an array of fieldscase_insensitive:false# Default to strict case sensitivity
)
end
The text was updated successfully, but these errors were encountered:
I'm going to close this since it's tightly related to the RFC issue already cited. I think the recommendation makes sense and will naturally come about during the validation improvement process.
Allow uniqueness validations scoped by other fields on the model.
Additionally, allow case-insensitive uniqueness validations.
Usage:
The text was updated successfully, but these errors were encountered: