aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-05-21 03:04:17 +0200
committerPratik Naik <pratiknaik@gmail.com>2009-05-21 03:04:17 +0200
commit5a036457620b7fb22027dc4f0c399871db6ed0c3 (patch)
tree240470960e6e1e408f5f2c765e30402fe07fcc4c /activesupport/lib
parente21d1614bb9006e69bf4bb2467b823aa12e64485 (diff)
downloadrails-5a036457620b7fb22027dc4f0c399871db6ed0c3.tar.gz
rails-5a036457620b7fb22027dc4f0c399871db6ed0c3.tar.bz2
rails-5a036457620b7fb22027dc4f0c399871db6ed0c3.zip
Allow Module#depends_on to accept multiple modules
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/dependency_module.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/dependency_module.rb b/activesupport/lib/active_support/dependency_module.rb
index 8c202acc8f..9872b9654b 100644
--- a/activesupport/lib/active_support/dependency_module.rb
+++ b/activesupport/lib/active_support/dependency_module.rb
@@ -16,10 +16,12 @@ module ActiveSupport
end
end
- def depends_on(mod)
- return if self < mod
- @_dependencies ||= []
- @_dependencies << mod
+ def depends_on(*mods)
+ mods.each do |mod|
+ next if self < mod
+ @_dependencies ||= []
+ @_dependencies << mod
+ end
end
end
end