```ruby
class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit

  validates :type, presence: true
  validates :unit_id, presence: true
end
```

Replace type with activity_type in the model
user
```ruby
class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit

  validates :activity_type, presence: true
  validates :unit_id, presence: true
end
```
assistant