education/classroom

View on GitHub
app/models/concerns/validates_not_reserved_word.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module ValidatesNotReservedWord
  extend ActiveSupport::Concern

  included do
    def self.validates_not_reserved_word(field)
      validates field, exclusion: {
        in: GitHubClassroom::Blacklist::NAMES,
        message: "is a reserved word"
      }
    end
  end
end