Errata


Print Print Icon

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question



Version Location Description Submitted By
Printed Page 257
dotted lines

Including the test for seat capacity in the validate method blocks editing of any seats on a full flight. Better would be to use validate_on_create:

class Seat < ActiveRecord::Base

belongs_to :flight

def validate
if baggage > flight.baggage_allowance
errors.add_to_base("The maximum baggage weight on this flight is " \
+ flight.baggage_allowance.to_s)
end
end

def validate_on_create
if flight.seats.size >= flight.capacity
errors.add_to_base("Sorry - this flight is already fully booked!")
end
end

end

Allan Kinnaird 
Printed Page 269
"screenshot"

The text, html source fragment and top of the screenshot refer to flight 2, but the seat list shown is for flight 1

Allan Kinnaird 
Printed Page 409
2nd example

This Oracle example won't work.
You should specify database: parameter whenever you use oracle driver (instead, host: is optional).

Akira Matsuda 


"I suggested Head First Rails to a friend before I even finished it. He was asking me questions that I didn't have time to answer, and I knew the book could explain better than I."
--Anita Kuno, Slashdot.org