Fix #1249: support relation by array attributes

Fix #1249: support relation by array attributes
does this line make sense after adding the code above?