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 acts on a
single connection to the database.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to