Class: PDNS::Record

Inherits:
ApplicationRecord show all
Defined in:
app/models/pdns/record.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#as_json

Instance Method Details

#mx?Boolean



22
23
24
# File 'app/models/pdns/record.rb', line 22

def mx?
  self.type == 'MX'
end

#update_serialObject



26
27
28
29
30
31
32
33
34
# File 'app/models/pdns/record.rb', line 26

def update_serial
  soa = Record.where(domain_id: domain_id, type: 'SOA').first
  unless soa.nil?
    list = soa.content.split(' ')
    serial = list[2]
    list[2] = serial.to_i + 1
    soa.update_column(:content, list.join(' '))
  end
end