mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't include anything else if AR::Model has already been included
This commit is contained in:
parent
35202aa691
commit
13945b06cc
2 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,8 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def self.included(base)
|
||||
return if base < Tag
|
||||
|
||||
base.class_eval do
|
||||
include Tag
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue