instance method
current_migration_number
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
current_migration_number()
No documentation comment.
Source
# File railties/lib/rails_generator/commands.rb, line 61
def current_migration_number
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
end
Defined in railties/lib/rails_generator/commands.rb line 61
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generator::Commands::Base