aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/inheritance_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/inheritance_test.rb')
-rw-r--r--activerecord/test/cases/inheritance_test.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb
index e7709c04c8..2ad8b30eae 100644
--- a/activerecord/test/cases/inheritance_test.rb
+++ b/activerecord/test/cases/inheritance_test.rb
@@ -483,15 +483,16 @@ class InheritanceComputeTypeTest < ActiveRecord::TestCase
original_type = Company.columns_hash["type"].default
ActiveRecord::Base.connection.change_column_default :companies, :type, 'Firm'
Company.reset_column_information
- # this is the case when attrs is a +Hash+, but we didn't specify the type,
- # so we need default type.
- firm = Company.new(firm_name: 'Shri Hans Plastic')
+
+ firm = Company.new # without arguments
assert_equal 'Firm', firm.type
assert_instance_of Firm, firm
- firm = Company.new # this is the case when attrs is nil
+
+ firm = Company.new(firm_name: 'Shri Hans Plastic') # with arguments
assert_equal 'Firm', firm.type
assert_instance_of Firm, firm
- firm = Company.new(type: 'Client')
+
+ firm = Company.new(type: 'Client') # overwrite the default type
assert_equal 'Client', firm.type
assert_instance_of Client, firm
ensure