class Author < ApplicationRecord

  has_many :proverbs

  validates :name, presence: true
  validates :unique_id, presence: true, uniqueness: true

  def identify_uniquely
    self.unique_id = name.to_s.downcase.gsub(/[\W\s]/,'')
  end
end
