We get error, when inserting new record. in rails 1.2.3 & ruby 1.8.6

Hi,

I have a model name called 'Address' with 4
column(id,code,details,active).

Here i declared
set_primary_key :code.
and map these code to others table(association) and id is serial.

now i am not able to create new record for address(giving input for
code, details, active).

i am getting below error

code is not null..

Code value is not take and insert to table.

Any help would be appreciated..

Thanks & Regards,
Sathiyaraj Gurusamy