26 lines
939 B
Ruby
26 lines
939 B
Ruby
module JamRuby
|
|
class IcecastPath < ActiveRecord::Base
|
|
|
|
has_many :servers, :class_name => "JamRuby::IcecastServer", :inverse_of => :path, :foreign_key => "path_id"
|
|
has_many :templates, :class_name => "JamRuby::IcecastTemplate", :inverse_of => :path, :foreign_key => "path_id"
|
|
|
|
validates :base_dir, presence: true
|
|
validates :log_dir, presence: true
|
|
validates :web_root, presence: true
|
|
validates :admin_root, presence: true
|
|
|
|
def dumpXml (builder)
|
|
|
|
builder.tag! 'paths' do |paths|
|
|
paths.tag! 'basedir', base_dir
|
|
paths.tag! 'logdir', log_dir
|
|
paths.tag! 'pidfile', pid_file if pid_file
|
|
paths.tag! 'webroot', web_root
|
|
paths.tag! 'adminroot', admin_root
|
|
paths.tag! 'allow-ip', allow_ip if allow_ip
|
|
paths.tag! 'deny-ip', deny_ip if deny_ip
|
|
paths.tag! 'alias', :source => alias_source, :dest => alias_dest if alias_source
|
|
end
|
|
end
|
|
end
|
|
end |