orientation/orientation

View on GitHub
app/models/articles_tag.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ArticlesTag < ApplicationRecord
  belongs_to :article, counter_cache: :tags_count
  belongs_to :tag, counter_cache: :articles_count

  validates :article_id, uniqueness: { scope: :tag_id, case_sensitive: false }
end