class StopWord < ApplicationRecord
  validates :word, presence: true
  before_save :fix_formatting

  def fix_formatting
    self.word.downcase!
    self.word.gsub!(/[^a-zA-Z0-9]/, '')
  end
end
