Permalink
Browse files

update for rails 3.2.2 changes

  • Loading branch information...
1 parent bbb2583 commit ba1c21e65a58c04184a826643c9376eaf1e3c628 mpd committed Mar 2, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/acts_as_archive.rb
View
@@ -207,13 +207,9 @@ def delete_with_archive(arel, name=nil, binds=[])
@mutex ||= Mutex.new
@mutex.synchronize do
unless ActsAsArchive.disabled
- sql = to_sql(arel)
-
- # Put the id into place.
- # Line pulled from ActiveRecord::ConnectionAdapters::Mysql2Adapter.
- # May not be compatible with other datastores.
- sql = sql.gsub("\0") { quote(*(binds.dup).shift.reverse) }
-
+ bdup = binds.dup
+ sql = to_sql(arel, bdup)
+
from, where = /DELETE FROM (.+)/i.match(sql)[1].split(/\s+WHERE\s+/i, 2)
from = from.strip.gsub(/[`"]/, '').split(/\s*,\s*/)

0 comments on commit ba1c21e

Please sign in to comment.