Project

General

Profile

Bug #16193

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

Added by Dominic Cleal almost 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Bugzilla link:
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'

Associated revisions

Revision 9a1dfb99 (diff)
Added by Dominic Cleal almost 4 years ago

fixes #16193 - change templates.type default to known STI class

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3746 added

#2 Updated by Dominic Cleal almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 160

Also available in: Atom PDF