app/models/product.rb
def type
    unless self.product_type.nil?
      return self.product_type.name
    end
  end
# Returns the name of the product type if the product type isn't nil
Returns the name of the product type if the product type isn't nil
Returns the name of the product type if the product type isn ' t nil
def type
    unless self.product_type.nil?
      return self.product_type.name
    end
  end
def type unless self . product_type . nil? return self . product_type . name end end
Returns the name of the product type if the product type isn't nil
Returns the name of the product type if the product type isn ' t nil