AWDR Book - Need clarifications


Need some clarifications about a line in the book, Agile Web Development with Rails 2nd Edition, the latest pdf version.

The line is "Missing: no longer true". This can be found at pdf page 337 and book page 325. Both are the same page. It is on the side of the page like a note.

It is about how to insert data into a relational database using has_many with through.

I am hoping that it is saying that there is a better way to create data into relational database. Hopefully in version 1.2 of Rails.

Any idea what the "Missing: no longer true" means?

I am new and still stuck on how to add data into relational database using has_many :through.

Please advice.


It means that the Rails framework changed since I wrote that, and is added as a note to myself to go back and update the section before the final book is produced.



Thanks for the reply.

I hope 1.2 has something better as I am really confused about entering data in relational tables.

I am really confused about this part.

----------- start -----------------
u = User.create(:name => "dave" )
a = Article.create(:name => "Join Models" )

# You can't do this:
# a.users.create(...)
# You can do this...

a.readings.create(:user => u, :read_at =>, :rating => 5) <----- especially this part.
-------------- end ----------------

Only if you have time, please point me to some website or let me know what the last line means. Especially why there is a letter "a" at the start of a.readings.create(:user => u, :read_at =>, :rating => 5).

I am assuming that once "u = User.create(:name => "dave" )" is run "u" will have a value of the user_id of "dave". So that value goes to the last statment. Why is the "a" at the start of the last statement.

Anyone please do assist.


‘a’ is the article.

Thank you very much for the reply.


Dave, it is time to rename your book to Rails Bible or Koran or something...

I’ll look in to this