aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-19 05:10:55 -0700
committerXavier Noria <fxn@hashref.com>2010-04-19 05:10:55 -0700
commit792910bb69078ff1d14a6384b50e51aba2aae2dd (patch)
tree705defb52d5ac6eb903e97334de718defc7ba4e3 /activerecord/lib
parente00c72c9718e518eb99058781f6ee71fa46b38fe (diff)
parentad4615e97896428ca140411081442f1b5e7d6089 (diff)
downloadrails-792910bb69078ff1d14a6384b50e51aba2aae2dd.tar.gz
rails-792910bb69078ff1d14a6384b50e51aba2aae2dd.tar.bz2
rails-792910bb69078ff1d14a6384b50e51aba2aae2dd.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/rails/generators/active_record.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/rails/generators/active_record.rb b/activerecord/lib/rails/generators/active_record.rb
index 1ca838b4f2..d2b1e86857 100644
--- a/activerecord/lib/rails/generators/active_record.rb
+++ b/activerecord/lib/rails/generators/active_record.rb
@@ -19,10 +19,11 @@ module ActiveRecord
# Implement the required interface for Rails::Generators::Migration.
#
def self.next_migration_number(dirname) #:nodoc:
+ next_migration_number = current_migration_number(dirname) + 1
if ActiveRecord::Base.timestamped_migrations
- Time.now.utc.strftime("%Y%m%d%H%M%S")
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
else
- "%.3d" % (current_migration_number(dirname) + 1)
+ "%.3d" % next_migration_number
end
end
end