Bug of comparison of string and symbol was fixed when adding foreign key