# LineCodeValidator## Custom validator for GitLab line codes.classLineCodeValidator<ActiveModel::EachValidatorPATTERN=/\A[a-z0-9]+_\d+_\d+\z/.freezedefvalidate_each(record,attribute,value)unlessvalue=~PATTERNrecord.errors.add(attribute,"must be a valid line code")endendend