class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit

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

class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit

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

Replace type with activity_type in the model
FIX: Replace type with activity_type in the model
