mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
deprecate the subdirectories parameter to migrations
This commit is contained in:
parent
f194ff9d02
commit
42fd1642bd
1 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
require "active_support/core_ext/module/delegation"
|
||||
require "active_support/core_ext/class/attribute_accessors"
|
||||
require 'active_support/deprecation'
|
||||
|
||||
module ActiveRecord
|
||||
# Exception that can be raised to stop migrations from going backwards.
|
||||
|
@ -523,7 +524,7 @@ module ActiveRecord
|
|||
File.basename(filename)
|
||||
end
|
||||
|
||||
delegate :migrate, :announce, :write, :to=>:migration
|
||||
delegate :migrate, :announce, :write, :to => :migration
|
||||
|
||||
private
|
||||
|
||||
|
@ -609,7 +610,14 @@ module ActiveRecord
|
|||
migrations_paths.first
|
||||
end
|
||||
|
||||
def migrations(paths, subdirectories = true)
|
||||
def migrations(paths, *args)
|
||||
if args.empty?
|
||||
subdirectories = true
|
||||
else
|
||||
subdirectories = args.first
|
||||
ActiveSupport::Deprecation.warn "The `subdirectories` argument to `migrations` is deprecated"
|
||||
end
|
||||
|
||||
paths = Array(paths)
|
||||
|
||||
glob = subdirectories ? "**/" : ""
|
||||
|
|
Loading…
Reference in a new issue