24 lines
1001 B
Ruby
24 lines
1001 B
Ruby
module JamRuby
|
|
class IcecastAdminAuthentication < ActiveRecord::Base
|
|
|
|
has_many :servers, :class_name => "JamRuby::IcecastServer", :inverse_of => :admin_auth, :foreign_key => "admin_auth_id"
|
|
has_many :templates, :class_name => "JamRuby::IcecastTemplate", :inverse_of => :admin_auth, :foreign_key => "admin_auth_id"
|
|
|
|
validates :source_password, presence: true, length: {minimum: 5}
|
|
validates :admin_password, presence: true, length: {minimum: 5}
|
|
validates :relay_user, presence: true, length: {minimum: 5}
|
|
validates :relay_password, presence: true, length: {minimum: 5}
|
|
validates :admin_user, presence: true, length: {minimum: 5}
|
|
|
|
def dumpXml (builder)
|
|
|
|
builder.tag! 'authentication' do |auth|
|
|
auth.tag! 'source-password', source_password
|
|
auth.tag! 'admin-user', admin_user
|
|
auth.tag! 'relay-user', relay_user
|
|
auth.tag! 'relay-password', relay_password
|
|
auth.tag! 'admin-password', admin_password
|
|
end
|
|
end
|
|
end
|
|
end |