From 8fd5ab2e4f96d0b5750268a210121517d9e8fd12 Mon Sep 17 00:00:00 2001 From: Frank Sweetser Date: Tue, 1 Jun 2010 22:18:28 -0400 Subject: [PATCH] Check for existence of family_id before referencing it --- app/models/operatingsystem.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/app/models/operatingsystem.rb b/app/models/operatingsystem.rb index e0062d3..0f72bb3 100644 --- a/app/models/operatingsystem.rb +++ b/app/models/operatingsystem.rb @@ -17,7 +17,7 @@ class Operatingsystem < ActiveRecord::Base # Emulate multiple inheritance from a virtual Family class def after_initialize - extend eval("Family::#{Family::FAMILIES[family_id]}") if self.respond_to?(:family_id) and not family_id.nil? + extend eval("Family::#{Family::FAMILIES[family_id]}") if defined? family_id and self.respond_to?(:family_id) and not family_id.nil? end def family -- 1.6.6.1