Hi, I'm loving sequel but having some difficulties handling associations.
Say I have a blacklist object linked to many results, and I want to delete 
the blacklist object nad put to nil all the Result.blacklist_id I have. I 
did it this way:

    result = Result[params[:id]]
      result.blacklist.results.each do |r|
        r.blacklist = nil
        r.save
      end
      result.blacklist.destroy

This code is pretty ugly and doesn't even work all that well. Does anybody 
have any suggestion on how to improve it? I've read the docs and saw I 
should have a remove_blacklist but I don't have it...

  ngw

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to