modify belongs_to in the function

add some functions to user model
test ressource