[Nitro] Og create method

Matthew B Gardner weather at speakeasy.net
Sun Aug 19 19:10:43 EDT 2007


I'm getting a database error when using Class#create -- this is an example of 
the error:

ERROR: DB error Duplicate entry '6' for key 1, [INSERT INTO ogcharacter 
(`oid`, `aliases`, `name`, `account_oid`) VALUES (6, '--- []\n\n', 'Tester', 
4)]

The code is:

self.character = Character.create msg.capitalize, self

This problem doesn't occur if I use:

self.character = Character.new msg.capitalize, self
self.character.save!

I'm guessing that the first code is trying to insert itself twice? Am I doing 
something wrong w/ #create?

Thanks for any help,
Matt


More information about the Nitro-general mailing list