Refactor #260

Switch family implemetation to use STI

Added by Paul Kelly over 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:05/21/2010
Priority:NormalDue date:
Assigned To:Paul Kelly% Done:

100%

Category:Rails
Target version:0.1-6
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

The home grown class inheritance stuff in family is confusing.
Switch to using a set of classes based upon the Operatingsystem


Related issues

Blocks Foreman - Feature #178: Automate populating the TFTP directory Closed 03/14/2010

Associated revisions

Revision 2c83f744
Added by Paul Kelly about 4 years ago

Fixes #260 - Switch to using STI for OS families

History

#1 Updated by Paul Kelly over 4 years ago

  • Status changed from New to Feedback
  • Branch set to refactor/260-family-with-sti

#2 Updated by Paul Kelly about 4 years ago

By adding a 'type' field to the operatingsystem record and then managing this field manually we can make Rails cast the record to the required family class.

#3 Updated by Ohad Levy about 4 years ago

  • Target version set to 0.1-6

#4 Updated by Paul Kelly about 4 years ago

Fixed for 1.5
Tests work

#5 Updated by Paul Kelly about 4 years ago

Added OS before_filter to deduce the family, if not set
OS DB entries can now contain a null type
@@families promoted to Operatingsystem::FAMILIES
Included mods suggested by Ohad

#6 Updated by Paul Kelly about 4 years ago

Rebased
Centralized Family name and os membership list into a single hash
Added test in unattended controller that detects if a os has no family
simplified deduce_family
tests pass

#7 Updated by Paul Kelly about 4 years ago

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

#8 Updated by Ohad Levy about 4 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF