create or update_attribute method

Dear all

Are there any method to create or update something? (if something exist,
then update, else create....where something is the primary key)

Something like....
if Klass.find_by_something( xxx )
   Klass.update_attribute your_hash
  Klass.create your_hash

This is similar to the AR dynamic finder
Klass.find_or_create_by_something()..., but I want a
Klass.create_or_update_by_something...Any idea??

Many thanks

I don't think so, how about:
k}.join("_and_")}", *{|k,v| v})
WARNING: This is a quick solution and could break because I'm relying
on the fact that the hash will return in the same order for both calls

Andrew Timberlake - The SIMPLE way to manage your savings