1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #21961 from Gaurav2728/migration_class_methods_nodoc

migrations Class methods have nodoc, fix it for API [ci skip]
This commit is contained in:
Arthur Nogueira Neves 2015-10-14 14:18:23 -04:00
commit 3ad381c3f8

View file

@ -10,22 +10,22 @@ module Rails
extend ActiveSupport::Concern
attr_reader :migration_number, :migration_file_name, :migration_class_name
module ClassMethods
def migration_lookup_at(dirname) #:nodoc:
module ClassMethods #:nodoc:
def migration_lookup_at(dirname)
Dir.glob("#{dirname}/[0-9]*_*.rb")
end
def migration_exists?(dirname, file_name) #:nodoc:
def migration_exists?(dirname, file_name)
migration_lookup_at(dirname).grep(/\d+_#{file_name}.rb$/).first
end
def current_migration_number(dirname) #:nodoc:
def current_migration_number(dirname)
migration_lookup_at(dirname).collect do |file|
File.basename(file).split("_").first.to_i
end.max.to_i
end
def next_migration_number(dirname) #:nodoc:
def next_migration_number(dirname)
raise NotImplementedError
end
end