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