Foreign key constraints can help with referential integrity (you cannot insert data belonging to a book that does not exist, for example). Foreign keys also provide referential integrity of the database, not the integrity of the application layer (model).
The Rails team considered this important enough that they now automatically create foreign keys whenever you use references when creating your migrations.
source share