diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-10-18 15:54:01 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-10-18 15:54:01 +0000 |
commit | d6f49e4af114a28e48e5c36932d35eeef614d7a0 (patch) | |
tree | 62e54f712fd245431c61c114cf37a062297353f8 | |
parent | 34df379467af9541b2006fb2d5794b1ee4099e82 (diff) | |
download | rails-d6f49e4af114a28e48e5c36932d35eeef614d7a0.tar.gz rails-d6f49e4af114a28e48e5c36932d35eeef614d7a0.tar.bz2 rails-d6f49e4af114a28e48e5c36932d35eeef614d7a0.zip |
Fixed incorrect migration number if script/generate executed outside of Rails root (closes #7080) [jeremymcanally]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7963 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/commands.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 9b00304cb9..6a6561a25c 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed incorrect migration number if script/generate executed outside of Rails root #7080 [jeremymcanally] + * Update Prototype to 1.6.0_rc1 and script.aculo.us to 1.8.0 preview 0. [sam, madrobby] * Generated fixtures use the actual primary key instead of id. #4343 [Frederick Ros, Tarmo Tänav] diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index b541c6f65d..98531d9771 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -70,7 +70,7 @@ module Rails end def current_migration_number - Dir.glob("#{@migration_directory}/[0-9]*.rb").inject(0) do |max, file_path| + Dir.glob("#{RAILS_ROOT}/#{@migration_directory}/[0-9]*_*.rb").inject(0) do |max, file_path| n = File.basename(file_path).split('_', 2).first.to_i if n > max then n else max end end |