Permalink
Browse files

deprecate the subdirectories parameter to `migrations`

  • Loading branch information...
1 parent f194ff9 commit 42fd1642bd3c76d4eef6bc4aebe774319cbcdf78 @tenderlove tenderlove committed Jan 10, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 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 @@ def basename
File.basename(filename)
end
- delegate :migrate, :announce, :write, :to=>:migration
+ delegate :migrate, :announce, :write, :to => :migration
private
@@ -609,7 +610,14 @@ def migrations_path
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 ? "**/" : ""

0 comments on commit 42fd164

Please sign in to comment.