提交 3ad381c3 编写于 作者: A Arthur Nogueira Neves

Merge pull request #21961 from Gaurav2728/migration_class_methods_nodoc

migrations Class methods have nodoc, fix it for API [ci skip]
......@@ -10,22 +10,22 @@ module Migration
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册