Permalink
Browse files

Don't copy deleted_at column when restoring

  • Loading branch information...
1 parent 6bd1427 commit 214d2330a5a458cc836a5c8edea8133c779e8f3d @winton committed Apr 24, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/acts_as_archive/base/restore.rb
@@ -13,9 +13,10 @@ module ClassMethods
def copy_from_archive(conditions)
add_conditions!(where = '', conditions)
+ col_names = column_names - [ 'deleted_at' ]
connection.execute(%{
- INSERT INTO #{table_name} (#{column_names.join(', ')})
- SELECT #{column_names.join(', ')}
+ INSERT INTO #{table_name} (#{col_name.join(', ')})
+ SELECT #{col_name.join(', ')}
FROM archived_#{table_name}
#{where}
})

0 comments on commit 214d233

Please sign in to comment.