fix bug on rails app side with associations