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 #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • Translation missing: en.field_release set to 160
Actions

Also available in: Atom PDF