Quick question, using ActiveRecord,

  catBike = Category.new(:name => "Bikes")
  catBike.save

  p = Product.new(:name => "Bike", :price => 900)
  p.categories << catBike
  p.save

p.categories now has TWO catBike

however, if I move the save before adding the categories it is fine.

I am curious why this happens. Thanks!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to