Validating phone numbers

Look into some of Rails models' built-in hooks -- in your case, I think before_validate would be a good choice.

before_validate :cleanup_mobile_number

def cleanup_mobile_number
    mobile = ....
end

Scott