added AR patch for empty attributes
added test method for db error