# File lib/acts_as_restorable.rb, line 41 def before_destory_with_backup dependents = [] self.class.reflect_on_all_associations.each do |association| dependents << association.name if association.options[:dependent] == :destroy end self.class.read_inheritable_attribute(:backup_table).create( :model => self.class.to_s, :model_primary_key => self.id, :record_data => self.to_xml(:include => dependents) ) before_destory_without_backup end