|
|
@ -1,6 +1,6 @@ |
|
|
|
class Record < ActiveRecord::Base |
|
|
|
class Record < ActiveRecord::Base |
|
|
|
stampable |
|
|
|
stampable |
|
|
|
audited |
|
|
|
audited on: [:create] |
|
|
|
|
|
|
|
|
|
|
|
belongs_to :domain, :inverse_of => :records |
|
|
|
belongs_to :domain, :inverse_of => :records |
|
|
|
belongs_to :user, :inverse_of => :records |
|
|
|
belongs_to :user, :inverse_of => :records |
|
|
@ -8,6 +8,7 @@ class Record < ActiveRecord::Base |
|
|
|
|
|
|
|
|
|
|
|
cattr_reader :types |
|
|
|
cattr_reader :types |
|
|
|
@@types = %w(SOA NS A MX TXT CNAME AAAA SRV) |
|
|
|
@@types = %w(SOA NS A MX TXT CNAME AAAA SRV) |
|
|
|
|
|
|
|
attr_accessible :name, :content, :ttl, :prio |
|
|
|
|
|
|
|
|
|
|
|
validates :domain, :name, :presence => true |
|
|
|
validates :domain, :name, :presence => true |
|
|
|
validates :type, :inclusion => {:in => @@types, :message => "Unknown record type"} |
|
|
|
validates :type, :inclusion => {:in => @@types, :message => "Unknown record type"} |
|
|
|