From f2fd9b25c40558787f07363bc3fef5741267061d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 18 Nov 2012 12:26:24 +0100 Subject: [PATCH] Improved error handling. --- .gitignore | 3 +++ app/models/application_model.rb | 2 ++ app/models/ticket.rb | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6203373e9..62f488a3c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ Gemfile.lock # Ignore .swp files .*.swp +# Ignore coverage stuff +/coverage/* + # Ignore local changes to schema.rb (e. g. through extentions) db/schema.rb diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 138a87db5..a9dbd459e 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -1,3 +1,5 @@ +require 'Cache' + class ApplicationModel < ActiveRecord::Base self.abstract_class = true diff --git a/app/models/ticket.rb b/app/models/ticket.rb index 7afa97453..3c4f34f28 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -24,12 +24,12 @@ class Ticket < ApplicationModel def number_adapter=(adapter_name) return @@number_adapter if @@number_adapter - case adapter_name + case adapter_name when Symbol, String - require "ticket/number/#{adapter_name.to_s.downcase}" + require "ticket/number/#{adapter_name.to_s.downcase}" @@number_adapter = Ticket::Number.const_get("#{adapter_name.to_s.capitalize}") else - raise "Missing number_adapter #{adapter_name}" + raise "Missing number_adapter '#{adapter_name}'" end end