How do I get ActiveRecord::Base create to insert what I tell

Example:

Subject.create(:id => 5, :updated_on => ‘2006-10-08 5:28:33’)

If you look in the db it has:

subject:

id: 1
updated_on: 2006-12-06 (whatever CURDATE() TIME() is)

If I look in the log it has the actual query used as:

INSERT INTO tablName (updated_on) VALUES (2006-12-06);

So we can see that it’s completely ignored the explicit setting of id
as well as the value given for updated_on.

I did a lot of googling and found this:

ActiveRecord::Base.record_timestamps = false

Which turns off the ignoring of the updated_on value but this option
was pretty heavily burried in the api docs under Timestamp.

Is there a way to get create to just insert what I tell it to or should
I drop back to db = Mysql.new(*args) db.query(myquery) type stuff when
I need to do this?

I think this is a matter of portability. I remember that in MSSQL you
can not insert on an identity fields, but in MySQL you can even though
the field is set to auto increment.

However, it seems that

subject = Subject.new(:updated_on => ‘2006-10-08 5:28:33’)
subject.id = 5
subject.save

does what you need.