<commit_before>module ActiveModel
  module Validations
    class PhoneValidator < EachValidator
      def validate_each(record, attribute, value)
        country_code = Country.new(options[:country].to_s.upcase).country_code unless options[:country].blank?
        record.errors.add(attribute) if value.blank? || ! (options[:country].blank? ? Phony.plausible?(value) : Phony.plausible?(value, cc: country_code) )
      end

    end
  end
end<commit_msg>fix: phone validator accepts custom message<commit_after>module ActiveModel
  module Validations
    class PhoneValidator < EachValidator
      def validate_each(record, attribute, value)
        country_code = Country.new(options[:country].to_s.upcase).country_code unless options[:country].blank?
        record.errors.add(attribute, options[:message]) if value.blank? || ! (options[:country].blank? ? Phony.plausible?(value) : Phony.plausible?(value, cc: country_code) )
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.11204188481675392, 'fraction_numerical': 0.0, 'mean_word_length': 4.401129943502825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5555688', 'n_tokens_mistral': 274, 'n_tokens_neox': 275, 'n_words': 59}