Search engine don''t index << so it''s hard to find info about it. Let''s say I have: order = order.create item = Item.new Will order.items << item create a new entry for the item in DB or not? I''m having issues. -- Posted via http://www.ruby-forum.com/.
Hi -- On Sat, 26 Sep 2009, Fernando Perez wrote:> > Search engine don''t index << so it''s hard to find info about it. > > Let''s say I have: > > order = order.create > item = Item.new > > Will order.items << item create a new entry for the item in DB or not? > I''m having issues.Yes, it will save the item (assuming Order has many Items, Item belongs to Order). If it doesn''t, something else is wrong (like the item not being valid). David -- David A. Black, Director Ruby Power and Light, LLC (http://www.rubypal.com) Ruby/Rails training, consulting, mentoring, code review Book: The Well-Grounded Rubyist (http://www.manning.com/black2)
> Yes, it will save the item (assuming Order has many Items, Item > belongs to Order). If it doesn''t, something else is wrong (like the > item not being valid).Nice catch, one of my items was not valid. -- Posted via http://www.ruby-forum.com/.
For the future: go to: "http://api.rubyonrails.org/" use your browser''s find to search for: "<<" On Sep 26, 3:15 pm, Fernando Perez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Yes, it will save the item (assuming Order has many Items, Item > > belongs to Order). If it doesn''t, something else is wrong (like the > > item not being valid). > > Nice catch, one of my items was not valid. > -- > Posted viahttp://www.ruby-forum.com/.