[Rails] atomic INSERT or UPDATE with activerecord

2009-11-08 Thread eugenio.mode...@gmail.com
what i need: if :record is in the database -> upgrade his counter else create :record (with his counter on 1) this should be done with an atomic operation, to avoid race conditions. What is the best way to do this with activerecord? I read about transactions, but as i understand a transaction act

[Rails] acts_as_taggable_on_steroids

2009-10-21 Thread eugenio.mode...@gmail.com
hi, i'm playing with acts_as_taggable_on_steroids plugin and i find it very nice but i got stuck on find_tagged_with ordering options. suppose i got a model "book" that acts_as_taggable. when i search for Book.find_tagged_with(["a","b","c"]) i got the books that have any of these tags. Is there a