From: Josh Cheek Date: 2010-02-15T17:09:38+09:00 Subject: Re: Compare and delete element from an array --001636b2b0fae7a566047f9f0c40 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Mon, Feb 15, 2010 at 1:44 AM, Greg Ma wrote: > Thanks for the explanation! > I finally found my error. In fact the delete_if was correcty working but > the modification from the array wasnt reproduce on the database. > What am i missing to do so? > > Greg > -- > Posted via http://www.ruby-forum.com/. > > Sounds like a Rails/ActiveRecord question, you'll probably have more luck o= n that mailing list http://groups.google.com/group/rubyonrails-talk But for a good place to start, I assume you have a has_and_belongs_to_many association, in which case the guides imply you can just use delete http://guides.rubyonrails.org/association_basics.html#has-and-belongs-to-ma= ny-association-reference 4.4.1.4 collection.delete(object, =85) The collection.delete method removes one or more objects from the collectio= n by deleting records in the join table. This does not destroy the objects. @part.assemblies.delete(@assembly1) --001636b2b0fae7a566047f9f0c40--