diff options
author | aditya-kapoor <aditya.kapoor@vinsol.com> | 2013-05-09 23:50:05 +0530 |
---|---|---|
committer | aditya-kapoor <aditya.kapoor@vinsol.com> | 2013-05-09 23:50:05 +0530 |
commit | fe7cf89193bcbb92d1a4dd86e67da9627c20a167 (patch) | |
tree | 9c1bd71d6061a9c695e5243843be06b0131b81d1 /activerecord | |
parent | e6cebce48cdd0cffec1a4e85b76108c3a9f4968f (diff) | |
download | rails-fe7cf89193bcbb92d1a4dd86e67da9627c20a167.tar.gz rails-fe7cf89193bcbb92d1a4dd86e67da9627c20a167.tar.bz2 rails-fe7cf89193bcbb92d1a4dd86e67da9627c20a167.zip |
Added documentation for ActiveRecord::Base#next_migration_number
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 6c020e1d57..4a04748680 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -668,6 +668,11 @@ module ActiveRecord copied end + # Determines the version number of the next migration + # if the timestamped migrations are activated then the comparison with the current time is made + # and then higer of the two values is selected + # For non timestamped values, the simple numbers are used in the format of "057", "570" + def next_migration_number(number) if ActiveRecord::Base.timestamped_migrations [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % number].max |