```ruby
class Channel < ApplicationRecord
  belongs_to :category
  has_many :shows
  has_many :schedules, through: :shows
  validates :name, presence: true, uniqueness: true
end
```

Change order of attributes in Channel model.
user
```ruby
class Channel < ApplicationRecord
  belongs_to :category
  has_many :schedules, through: :shows
  has_many :shows
  validates :name, presence: true, uniqueness: true
end
```
assistant