multi validation

how would you validate one of two fields

users can upload an image from either the file system or from a url

in the model how do you validate that at least only one is being used


validates_presence_of :img_path or validates_presence_of :img_url



could I do somethink like this

validates _presence_of :img_path if => {:img_url.nil?}

the syntax of this is not quite right but