Duplicate entry 'S000018' for key 'PRIMARY'

12 views
Skip to first unread message

Christoph Blank

unread,
Dec 9, 2013, 7:57:04 AM12/9/13
to datam...@googlegroups.com
Hi there,

I've got a weird error, I want to insert an object with the following code:

p = Property.first_or_create(:id => params[:propertyID])

It doesn't exist before this. The code is S000018. 
And I get exceptions like Duplicate entry 'S000018' for key 'PRIMARY'

Can anyone tell me why this happens and how to prevent it?

Thanks a lot,
Christoph
Reply all
Reply to author
Forward
0 new messages