diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-23 05:49:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-23 05:49:40 +0000 |
commit | 8cbe22ab5155680fa0ef2da4321a4f291aaf78fe (patch) | |
tree | 6b4c0676a61a4d18aefe477195236b599010aa5d /activerecord/lib | |
parent | 32dcfa69131e1a26829e392cc66093624226be83 (diff) | |
download | rails-8cbe22ab5155680fa0ef2da4321a4f291aaf78fe.tar.gz rails-8cbe22ab5155680fa0ef2da4321a4f291aaf78fe.tar.bz2 rails-8cbe22ab5155680fa0ef2da4321a4f291aaf78fe.zip |
Migrations: gracefully handle missing migration files. Closes #5857.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4809 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index acafda0048..cca46f1df4 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -382,7 +382,8 @@ module ActiveRecord end def reached_target_version?(version) - (up? && version.to_i - 1 == @target_version) || (down? && version.to_i == @target_version) + return false if @target_version == nil + (up? && version.to_i - 1 >= @target_version) || (down? && version.to_i <= @target_version) end def irrelevant_migration?(version) |