Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5402164
schedule.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
Wed, Sep 9, 8:23 PM
Size
484 B
Mime Type
text/x-ruby
Expires
Fri, Sep 11, 8:23 PM (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
443444
Attached To
rARCHIVING archiving
schedule.rb
View Options
class
Schedule
<
ActiveRecord
::
Base
has_many
:schedule_runs
belongs_to
:host
validates
:name
,
presence
:
true
validates
:name
,
uniqueness
:
{
scope
:
:host
}
validates_with
NameValidator
accepts_nested_attributes_for
:schedule_runs
def
to_bacula_config_array
[
'Schedule {'
]
+
[
" Name =
\"
#{
name_for_config
}
\"
"
]
+
schedule_runs
.
map
{
|
r
|
" Run =
#{
r
.
schedule_line
}
"
}
+
[
'}'
]
end
def
name_for_config
[
host
.
name
,
name
].
join
(
' '
)
end
end
Event Timeline
Log In to Comment