'id' not being correctly set when creating new record

(spun off from my problem with acts_as_attachment)

I’m seeing a problem where the id is not being set when a record is
saved. I set up a new, simple Rails app, with one database table. I
try this in the console:

~/RoR/testaaa john$ script/console
Loading development environment.

b=Book.new
=> #<Book:0x255cab4 @attributes={“name”=>nil}, @new_record=true>

b.name=“asdf”
=> “asdf”

b.save
=> true

b
=> #<Book:0x255cab4 @errors=#<ActiveRecord::Errors:0x24344ac
@errors={}, @base=#<Book:0x255cab4 …>>, @attributes={“name”=>“asdf”,
“id”=>0}, @new_record=false>

Now, I’m pretty sure that after saving the id should be set to the id
of the record. Looking at the db (sqlite in this case), the id is
being properly autoincremented and set:

~/RoR/testaaa john$ sqlite3 db/testaaa_development
SQLite version 3.1.3
Enter “.help” for instructions
sqlite> select * from books;
1|hsfd

Has anyone seen this? I’ve got up to date gems.

Thanks!

On 9/9/06, John T. [email protected] wrote:

(spun off from my problem with acts_as_attachment)

I’m seeing a problem where the id is not being set when a record is
saved. I set up a new, simple Rails app, with one database table. I
try this in the console:

For anyone else who happens to run into this. Apparently, something
changed somewhere to cause sqlite3 and ruby to not work (some details
here:

)

I ended up installing SWIG from source (I don’t have Darwinports
installed), and removed and reinstalled the sqlite3 gem and it’s all
working again.