Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5131119
domain.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 17, 1:47 PM
Size
678 B
Mime Type
text/x-ruby
Expires
Wed, Aug 19, 1:47 PM (14 h, 41 m)
Engine
blob
Format
Raw Data
Handle
432546
Attached To
rWEBDNS WebDNS (edet4)
domain.rb
View Options
class
Domain
<
ActiveRecord
::
Base
self
.
inheritance_column
=
:nx
def
self
.
domain_types
[
'NATIVE'
,
'MASTER'
,
'SLAVE'
,
]
end
has_many
:records
has_one
:soa
,
class_name
:
SOA
validates
:name
,
uniqueness
:
true
,
presence
:
true
validates
:type
,
presence
:
true
,
inclusion
:
{
in
:
domain_types
}
after_create
:generate_soa
attr_writer
:serial_strategy
def
serial_strategy
@serial_strategy
||=
WebDNS
.
settings
[
:serial_strategy
]
end
def
reverse?
name
.
end_with?
(
'.in-addr.arpa'
)
||
name
.
end_with?
(
'.ip6.arpa'
)
end
private
# Hooks
def
generate_soa
soa_record
=
SOA
.
new
(
domain
:
self
)
soa_record
.
save
end
end
Event Timeline
Log In to Comment