views:

55

answers:

1

I have a simple model, Post with title and content.

I'm trying to link Post & Users together by the post unique_id and the user unique_id

In the course of my testing I've noticed that object_id is not the unique id of the record in the database. It changes with every page refresh.

My schema does not explicitly state the need for a unique id since I thought that attribute was automatically generated.

So, should i change my schema to have a unique id or can I access it through another method?

+1  A: 

Is this a trick question? You have post.id and user.id (Don't use post.object_id - maybe you were confused by that.)

Anonymous
not a trick question :) isn't post.id being deprecated for post.object_id ?
cbrulak
cbrulak