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