diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/concern.rb | 2 | ||||
-rw-r--r-- | activesupport/test/concern_test.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/concern.rb b/activesupport/lib/active_support/concern.rb index a09a2420b3..dcf1e8152f 100644 --- a/activesupport/lib/active_support/concern.rb +++ b/activesupport/lib/active_support/concern.rb @@ -19,5 +19,7 @@ module ActiveSupport super end end + + alias_method :include, :depends_on end end diff --git a/activesupport/test/concern_test.rb b/activesupport/test/concern_test.rb index 40fcb7c57f..4cbe56a2d2 100644 --- a/activesupport/test/concern_test.rb +++ b/activesupport/test/concern_test.rb @@ -34,7 +34,7 @@ class ConcernTest < Test::Unit::TestCase module Bar extend ActiveSupport::Concern - depends_on Baz + include Baz def bar "bar" @@ -48,7 +48,7 @@ class ConcernTest < Test::Unit::TestCase module Foo extend ActiveSupport::Concern - depends_on Bar, Baz + include Bar, Baz end def setup @@ -90,7 +90,7 @@ class ConcernTest < Test::Unit::TestCase assert @klass.included_modules.include?(ConcernTest::Bar) end - def test_depends_on_with_multiple_modules + def test_dependencies_with_multiple_modules @klass.send(:include, Foo) assert_equal [ConcernTest::Foo, ConcernTest::Bar, ConcernTest::Baz::InstanceMethods, ConcernTest::Baz], @klass.included_modules[0..3] end |