RE: [Rails] ActiveRecord can do conditonal update?

ActiveRecord update method can support condition (SQL where clause)?

My rails application always query data by some unique key
then update this data (if no data, create one). It is two SQL
statement. Want to improve the performance, combine it into
one SQL update statement.

if ActiveRecord not support, can i have some way to customize
ActiveRecord ?

you'll need to check the update count to see if the object doesn't
already exist, of course.

- donald