Are there any difference between data integrity and data consistency?

They are not only different, they are orthogonal. Inconsistency: A DB that reported employee Joe Shmoe’s department as Sales but that didn’t list Joe Shmoe among the employees in the Sales department would be inconsistent. It’s a logical property of the DB, independent of the actual data. Integrity: A DB that reported jOe SaleS to … Read more

Rails 3: Validate combined values

Bear with me. The way the validates method in ActiveModel works is to look for a Validator. :presence => true looks for PresenceValidator and passes the options: true to the validator’s initializer. I think you want validates :husband, :presence => true, :uniqueness => {:scope => :wife} (The uniqueness validator is actually part of ActiveRecord, not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)