Subclass does not call super in constructor

I am working with the book agile Web D. second edition, and in
page 110 there is an example i how to create the model CartItem.

I am using rails 2.0 and after adding the class CartItem I get an error
at the constructor Initialize

class CartItem < ActiveRecord::Base
attr_reader :product, :quantity

def initialize(product)
@product = product
@quantity = 1
end

it underlines the word “initialize” and says “Subclass does not call
super in constructor”

On Sun, Jul 27, 2008 at 12:09 AM, Pepe S.
[email protected] wrote:

I am working with the book agile Web D. second edition, and in
page 110 there is an example i how to create the model CartItem.

I am using rails 2.0 and after adding the class CartItem I get an error
at the constructor Initialize

class CartItem < ActiveRecord::Base

Check the example again - CartItem doesn’t inherit from ActiveRecord.

Barry