diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index 07d538f6bc..d092e748e8 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -6,6 +6,14 @@ class BasicInclusionModelTest < ActiveRecord::TestCase Teapot.create!(:name => "Ronnie Kemper") assert_equal "Ronnie Kemper", Teapot.find(1).name end + + def test_inherited_model + teapot = CoolTeapot.create!(:name => "Bob") + teapot.reload + + assert_equal "Bob", teapot.name + assert_equal "mmm", teapot.aaahhh + end end class InclusionUnitTest < ActiveRecord::TestCase diff --git a/activerecord/test/models/teapot.rb b/activerecord/test/models/teapot.rb index 638a1b38f8..00e066a1b3 100644 --- a/activerecord/test/models/teapot.rb +++ b/activerecord/test/models/teapot.rb @@ -11,3 +11,14 @@ class Teapot include ActiveRecord::Model end + +class OMFGIMATEAPOT + def aaahhh + "mmm" + end +end + +class CoolTeapot < OMFGIMATEAPOT + include ActiveRecord::Model + self.table_name = "teapots" +end