Module: Bard::Backup::Database
- Defined in:
- lib/bard/backup/database.rb
Class Method Summary collapse
Class Method Details
.create!(destination_hashes = nil, **config) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bard/backup/database.rb', line 6 def self.create!(destination_hashes = nil, **config) if destination_hashes.nil? && !config.empty? destination_hashes = [config] end now = Time.now.utc backups = Destination.resolve(destination_hashes, now: now).map(&:call) return nil if backups.empty? Bard::Backup.new( timestamp: backups.first., size: backups.first.size, destinations: backups.flat_map(&:destinations), ) end |