schneidmaster/debatevid.io

View on GitHub
app/models/tag.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class Tag < ApplicationRecord
  has_many :tags_videos
  has_many :videos, through: :tags_videos

  validates :title, presence: true

  before_validation :downcase_title

  private

  def downcase_title
    title&.downcase!
  end
end