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/module/delegation"
|
||||||
require "active_support/core_ext/class/attribute_accessors"
|
require "active_support/core_ext/class/attribute_accessors"
|
||||||
|
require 'active_support/deprecation'
|
||||||
|
|
||||||
module ActiveRecord
|
module ActiveRecord
|
||||||
# Exception that can be raised to stop migrations from going backwards.
|
# Exception that can be raised to stop migrations from going backwards.
|
||||||
|
@ -523,7 +524,7 @@ module ActiveRecord
|
||||||
File.basename(filename)
|
File.basename(filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
delegate :migrate, :announce, :write, :to=>:migration
|
delegate :migrate, :announce, :write, :to => :migration
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -609,7 +610,14 @@ module ActiveRecord
|
||||||
migrations_paths.first
|
migrations_paths.first
|
||||||
end
|
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)
|
paths = Array(paths)
|
||||||
|
|
||||||
glob = subdirectories ? "**/" : ""
|
glob = subdirectories ? "**/" : ""
|
||||||
|
|
Loading…
Reference in a new issue