From 85e5fac959cc8345abf8690d1ba4ea11f6bc5732 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 13 Jan 2012 10:23:09 -0800 Subject: use the model to delete records --- activerecord/lib/active_record/migration.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index f0def7a265..999f7ed46a 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -752,13 +752,10 @@ module ActiveRecord end def record_version_state_after_migrating(version) - table = Arel::Table.new(self.class.schema_migrations_table_name) - @migrated_versions ||= [] if down? @migrated_versions.delete(version) - stmt = table.where(table["version"].eq(version.to_s)).compile_delete - Base.connection.delete stmt + ActiveRecord::SchemaMigration.where(:version => version.to_s).delete_all else @migrated_versions.push(version).sort! ActiveRecord::SchemaMigration.create!(:version => version.to_s) -- cgit v1.2.3