diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 00:33:05 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 11:08:16 +0000 |
commit | 13945b06ccde6979b10fce6fe68312077593f124 (patch) | |
tree | db425433fab71e61da8600b014f7be6f49b54fe8 /activerecord | |
parent | 35202aa6911679cccb8187d12996e3f30661385c (diff) | |
download | rails-13945b06ccde6979b10fce6fe68312077593f124.tar.gz rails-13945b06ccde6979b10fce6fe68312077593f124.tar.bz2 rails-13945b06ccde6979b10fce6fe68312077593f124.zip |
Don't include anything else if AR::Model has already been included
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/model.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/inclusion_test.rb | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb index e1d3db1aec..4e8ed14fb7 100644 --- a/activerecord/lib/active_record/model.rb +++ b/activerecord/lib/active_record/model.rb @@ -6,6 +6,8 @@ module ActiveRecord end def self.included(base) + return if base < Tag + base.class_eval do include Tag diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index 70f402024b..189e537bd6 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -65,6 +65,11 @@ class InclusionUnitTest < ActiveRecord::TestCase ensure ActiveRecord::Base.time_zone_aware_attributes = false end + + # Doesn't really test anything, but this is here to ensure warnings don't occur + def test_included_twice + @klass.send :include, ActiveRecord::Model + end end class InclusionFixturesTest < ActiveRecord::TestCase |