 <p>You can write some custom validation</p> <pre><code>validate do valid_phone_codes = [ "007", "042", ...] valid_phone_codes.each do |valid_code| # Also handle optional parenthesis return true if self.phone_number.starts_with?(valid_code, "(#{valid_code})") end errors.add(:phone_numbers, "Must start with a valid country code (one of #{valid_phone_codes.join(', ')}") false end </code></pre> <p>Or if you prefer, you can declare this code in a function <code>def valid_country_codes</code>, and then add a line</p> <pre><code>validate :valid_country_codes </code></pre>