Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F905123
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
Fri, Aug 29, 9:21 PM
Size
678 B
Mime Type
text/x-ruby
Expires
Sun, Aug 31, 9:21 PM (5 h, 50 m)
Engine
blob
Format
Raw Data
Handle
252480
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