Skip to content

Commit

Permalink
tables may also be escaped with "
Browse files Browse the repository at this point in the history
  • Loading branch information
comboy committed Jan 30, 2011
1 parent 077f09f commit 206d255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/acts_as_archive.rb
Expand Up @@ -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)
Expand All @@ -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 206d255

Please sign in to comment.