Nelson Hsu wrote: > cart_session.rb > > class CartSession > attr :items > attr_accessor :building > attr_accessor :use_corporate_account > end > > class CartSessionLineItem > attr_accessor :sku, :quantity, :sku_id > > def initialize(sku_id, quantity) > @sku_id = sku_id > @sku = Sku.find(sku_id) > @quantity = quantity > end > > def total > sku.skuable.price * quantity > end > > end
That looks right. Is there perhaps a fixture lingering around? >> Also note that inheritance is not equal to derivation. > > OK, I have to admit, I feel dumb here. I always thought inheriting from > a class was deriving from it. Is my terminology all messed up? I take that back and you are right. Must have had my head up in the clouds at that time of writing. :-) -- Roderick van Domburg http://www.nedforce.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---