Sha256: 9b35f72398ab72c9abd823466ef0b0051d6af82dac564713916601f87f26b694
Contents?: true
Size: 1.58 KB
Versions: 10
Compression:
Stored size: 1.58 KB
Contents
class GlacierOnRails::ApplicationDataBackupsController < ApplicationController before_action do @application_data_backup = ApplicationDataBackup.find(params[:application_data_backup_id]) unless params[:application_data_backup_id].nil? end def create @application_data_backup = ApplicationDataBackup.create if @application_data_backup.persisted? render :partial => 'glacier_on_rails/aws_archive_retrieval_jobs/application_data_backup', :locals => {:application_data_backup => @application_data_backup} else render :js => "flash.error('failed to create backup');", :status => 500 end end def fetch if @application_data_backup.fetch_archive render :partial => 'glacier_on_rails/aws_archive_retrieval_jobs/application_data_backup', :locals => {:application_data_backup => @application_data_backup} else render :partial => 'glacier_on_rails/aws_archive_retrieval_jobs/application_data_backup', :locals => {:application_data_backup => @application_data_backup, :fetch_fail => true} end end def restore if @application_data_backup.restore render :partial => 'glacier_on_rails/aws_archive_retrieval_jobs/application_data_backup', :locals => {:application_data_backup => @application_data_backup} else render :js => "flash.error('Database restore failed');", :status => 500 end end def destroy if @application_data_backup.destroy head :ok else render :js => "flash.error('Deletion of archive failed for some reason');", :status => 500 end end end
Version data entries
10 entries across 10 versions & 1 rubygems