From 5e04884bce611625a77784729bf9b8aaf60d67c8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 10 Jan 2012 13:17:35 -0800 Subject: deprecate the subdirectories parameter to `migrations` Conflicts: activerecord/lib/active_record/migration.rb --- activerecord/lib/active_record/migration.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 46464783fd..9093004852 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -1,6 +1,10 @@ require "active_support/core_ext/module/delegation" require "active_support/core_ext/class/attribute_accessors" +<<<<<<< HEAD require "active_support/core_ext/array/wrap" +======= +require 'active_support/deprecation' +>>>>>>> f00491b... deprecate the subdirectories parameter to `migrations` module ActiveRecord # Exception that can be raised to stop migrations from going backwards. @@ -508,7 +512,7 @@ module ActiveRecord File.basename(filename) end - delegate :migrate, :announce, :write, :to=>:migration + delegate :migrate, :announce, :write, :to => :migration private @@ -594,7 +598,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.wrap(paths) glob = subdirectories ? "**/" : "" -- cgit v1.2.3