```ruby
# == Schema Information
#
# Table name: tags
#
#  id         :integer          not null, primary key
#  title      :string
#  slug       :string
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class Tag < ApplicationRecord
  has_and_belongs_to_many :products
end
```

Tag validates name and slugs
user
```ruby
# == Schema Information
#
# Table name: tags
#
#  id         :integer          not null, primary key
#  title      :string
#  slug       :string
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class Tag < ApplicationRecord
  validates :name, :slug, presence: true
  has_and_belongs_to_many :products
end
```
assistant