Permalink
Browse files

Merged pull request #18 from comboy/master.

fix table quoting unescaping
  • Loading branch information...
2 parents 077f09f + 206d255 commit 2d778ea2b59e6d75b31e26c8453a2739ad94d8c1 @winton winton committed Apr 26, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/acts_as_archive.rb
View
@@ -208,7 +208,7 @@ def delete_sql_with_archive(sql, name = nil)
@mutex.synchronize do
unless ActsAsArchive.disabled
from, where = /DELETE FROM (.+)/i.match(sql)[1].split(/\s+WHERE\s+/i, 2)
- from = from.strip.gsub(/`/, '').split(/\s*,\s*/)
+ from = from.strip.gsub(/[`"]/, '').split(/\s*,\s*/)
ActsAsArchive.find(from).each do |config|
ActsAsArchive.move(config, where)
@@ -226,4 +226,4 @@ def delete_sql_with_archive(sql, name = nil)
::ActiveRecord::ConnectionAdapters::DatabaseStatements.send(:include, ::ActsAsArchive::DatabaseStatements)
require "acts_as_archive/adapters/rails#{Rails.version[0..0]}" if defined?(Rails)
-require "acts_as_archive/adapters/sinatra" if defined?(Sinatra)
+require "acts_as_archive/adapters/sinatra" if defined?(Sinatra)

0 comments on commit 2d778ea

Please sign in to comment.