changed array to relation in posts#index