Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fix table quoting unescaping #18

merged 1 commit into from Apr 26, 2011
Jump to file or symbol
Failed to load files and symbols.
+2 −2
@@ -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)