Sha256: 2af1804bf7e812b81056693415314f7afed2adeb124765d4e21c5e7d09c308cf

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

class GlacierDbArchive < GlacierArchive
  belongs_to :application_data_backup

  before_create do |db_archive|
    db_archive.filename = GlacierDbArchive.filename_from_time
  end

  def self.filename_from_time
    Time.now.strftime("%Y_%m_%d_%H_%M_%S_%L.sql").to_s
  end

  def archive_contents
    ApplicationDatabase.new.contents
  end

  # for file archive, true inhibits fetching archive from AWS
  # however we always want to fetch the db archive
  def exists_status?
    false
  end

  def restore
    raise RestoreFail unless ApplicationDatabase.new.restore(backup_file)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glacier_on_rails-1.0.0 app/models/glacier_db_archive.rb