I'm using Clearance for authentication in my Rails application. The Clearance::User
mixin adds a couple of validations to my User
model, but there's one of these that I would like to remove or override. What is the best way of doing this?
The validation in question is
validates_uniqueness_of :email, :case_sensitive => false
which in itself isn't bad, but I would need to add :scope => :account_id
. The problem is that if I add this to my User
model
validates_uniqueness_of :email, :scope => :account_id
I get both validations, and the one Clearance adds is more restrictive than mine, so mine has no effect. I need to make sure that only mine runs. How do I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…