class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit
  belongs_to :activity_type

  # Always check for presence of whole model instead of id
  # So validate presence of unit not unit_id
  # This ensures that id provided is also valid, so there exists an unit with that id
  validates :activity_type, presence: true
  validates :unit,          presence: true
end

class UnitActivitySet < ActiveRecord::Base
  belongs_to :unit
  belongs_to :activity_type

  has_many :campus_activity_sets

  # Always check for presence of whole model instead of id
  # So validate presence of unit not unit_id
  # This ensures that id provided is also valid, so there exists an unit with that id
  validates :activity_type, presence: true
  validates :unit,          presence: true
end

Add has many relationship between unit and campus sets
ENHANCE: Add has many relationship between unit and campus sets
