Project

General

Profile

Refactor #6596

'type' field in Katello::System incorrectly triggers STI for Host::Managed

Added by Joseph Magen over 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Target version:
Branch:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

I'm not sure why self.abstract_class = true in Katello::Model is not disabling STI.

Associated revisions

Revision 19b8185e (diff)
Added by Joseph Magen about 6 years ago

fixes #6596 - fixes #6596 - change 'type' method to 'system_type' in Katello::System

Revision 320daa67
Added by Justin Sherrill about 6 years ago

Merge pull request #4421 from isratrade/6596

fixes #6596 - change 'type' method to 'system_type' in Katello::System

History

#1 Updated by Joseph Magen over 6 years ago

if the type of Katello::System instance is 'Host', then when working the rails console, the class type returns Host::Managed

a = Katello::System.first

a.class

=> Host::Managed

#2 Updated by Joseph Magen over 6 years ago

  • Subject changed from refactor 'type' field in Katello::System that incorrect triggers STI to 'type' field in Katello::System incorrectly triggers STI for Host::Managed

#3 Updated by Ohad Levy over 6 years ago

the main concern here, is that once you initialize a katello::system object, from rails, its actually a host::managed object.

if you perform any action on it (like changing an environment_id) it would change the host table and not the katello systems table!!

#4 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Target version changed from 56 to 49
  • Pull request https://github.com/Katello/katello/pull/4421 added
  • Pull request deleted ()

#5 Updated by Joseph Magen about 6 years ago

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

#6 Updated by Eric Helms about 6 years ago

  • Legacy Backlogs Release (now unused) set to 13

Also available in: Atom PDF