module JamRuby
  class IcecastServerRelay < ActiveRecord::Base

    self.table_name = 'icecast_server_relays'

    attr_accessible :icecast_relay_id, :icecast_server_id, as: :admin

    belongs_to :relay, :class_name => "JamRuby::IcecastRelay", :foreign_key => 'icecast_relay_id', :inverse_of => :server_relays
    belongs_to :server, :class_name => "JamRuby::IcecastServer", :foreign_key => 'icecast_server_id', :inverse_of => :server_relays

    validates :server, :presence => true
    validates :relay, :presence => true


  end
end