module JamRuby
  class IcecastServerGroup < ActiveRecord::Base

    attr_accessible :name,  as: :admin

    has_many :users, class_name: "JamRuby::User", inverse_of: :icecast_server_group, foreign_key: 'icecast_server_group_id'
    has_many :servers, class_name: "JamRuby::IcecastServer", inverse_of: :server_group, foreign_key: 'icecast_server_group_id'

    validates :name, presence: true, uniqueness: true
  end
end