I'm going through Ruby on Rails Up and Running by O'Reilly and have run into a question that I'm not sure where to go to for help.
I'm at the part in the book where I'm creating new objects from the console and then saving them to the database. I've already created the database (MySQL), run the migration and finally verified that rails created the database schema (also have gone through the rest of the book to this point).
To create the object I ran the following commands:
ruby script/console
photo = Photo.new
The output that the book showed is:
#<Photo:0x35301d8 @attributes={"filename"=>""}, @new_record=true>
However, the output that I got was:
#<Photo id: nil, filename: nil>
From what I understand, when a new object is created in this manner a unique ID is generated to identify that object but it appears that in my case no unique id was generated. I've done quite a bit of googling on this and it's a difficult thing to search for because it's not an error message per-se; but I'm pretty sure something has gone wrong. So I thought I'd come to the stackoverflow community for help.
Thanks, Adam