From 8cbe22ab5155680fa0ef2da4321a4f291aaf78fe Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 23 Aug 2006 05:49:40 +0000 Subject: Migrations: gracefully handle missing migration files. Closes #5857. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4809 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/migration.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') 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) -- cgit v1.2.3