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?
By using custom validations we can do this operation
validate :validate_address
def validate_address errors.add(:permenent_address, "can't be the same as present_address") if self.present_address== self.permenent_address end