Project

General

Profile

Actions

Bug #16193

closed

'templates'.'type' column default is renamed ConfigTemplate class

Added by Dominic Cleal over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The 'templates'.'type' column has a default value of ConfigTemplate, a class that was renamed to Template when changed to STI in #7096. This should be updated.

On Rails 5, the unknown class causes an error loading test fixtures:

    DomainTest#test_0008_should update total_hosts on changing primary interface domain:
    ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'ConfigTemplate'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend
     it to be used for storing the inheritance class or overwrite Ptable.inheritance_column to use another column for that information.
        activerecord (5.0.0) lib/active_record/inheritance.rb:182:in `rescue in find_sti_class'
        activerecord (5.0.0) lib/active_record/inheritance.rb:175:in `find_sti_class'
        activerecord (5.0.0) lib/active_record/inheritance.rb:209:in `subclass_from_attributes'
        activerecord (5.0.0) lib/active_record/inheritance.rb:58:in `new'
Actions

Also available in: Atom PDF