diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-10 13:17:35 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-10 13:17:49 -0800 |
commit | 42fd1642bd3c76d4eef6bc4aebe774319cbcdf78 (patch) | |
tree | be8a175c770a64a0bc2b6ad6fb0f3c84e8249165 | |
parent | f194ff9d02d70d524d7415da858e38a874435d8d (diff) | |
download | rails-42fd1642bd3c76d4eef6bc4aebe774319cbcdf78.tar.gz rails-42fd1642bd3c76d4eef6bc4aebe774319cbcdf78.tar.bz2 rails-42fd1642bd3c76d4eef6bc4aebe774319cbcdf78.zip |
deprecate the subdirectories parameter to `migrations`
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index c57a637a34..4bd3962d3a 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -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 ? "**/" : "" |