diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 10:23:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 14:33:58 -0800 |
commit | 85e5fac959cc8345abf8690d1ba4ea11f6bc5732 (patch) | |
tree | 379270b441cb9e8d5a9ef7f98abb6476c9a0c13e /activerecord | |
parent | ad2af42bb299f762a5a969370ee5378d34ebbc53 (diff) | |
download | rails-85e5fac959cc8345abf8690d1ba4ea11f6bc5732.tar.gz rails-85e5fac959cc8345abf8690d1ba4ea11f6bc5732.tar.bz2 rails-85e5fac959cc8345abf8690d1ba4ea11f6bc5732.zip |
use the model to delete records
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 5 |
1 files changed, 1 insertions, 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) |