Skip to content

Commit

Permalink
Added the missing before and after backup callback configuration bloc…
Browse files Browse the repository at this point in the history
…ks that raise the undefined method errors.
  • Loading branch information
Michael van Rooijen committed Oct 3, 2010
1 parent 9e5d128 commit 3be0795
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/backup/configuration/base.rb
Expand Up @@ -4,7 +4,7 @@ class Base
extend Backup::Configuration::Attributes
generate_attributes %w(encrypt_with_password encrypt_with_gpg_public_key keep_backups notify)

attr_accessor :trigger, :storage_name, :adapter_name
attr_accessor :trigger, :storage_name, :adapter_name, :before_backup_block, :after_backup_block

def initialize(trigger)
@trigger = trigger
Expand All @@ -22,6 +22,14 @@ def storage(storage, &block)
@storage_configuration.instance_eval &block
end

def before_backup(&block)
@before_backup_block = block
end

def after_backup(&block)
@after_backup_block = block
end

def storage_class
case @storage_name.to_sym
when :cloudfiles then Backup::Storage::CloudFiles
Expand Down

0 comments on commit 3be0795

Please sign in to comment.