I have a User model, which has an email and a password field. For security, these may not be equal to each other. How can I define this in my model?
New way:
validates :password, exclusion: { in: lambda{ |user| [user.email] } }
or:
validates :password, exclusion: { in: ->(user) { [user.email] } }