fix primary key setting for rails4