From a4464d8a18d6c37980ace3c0679f58dd0b8d7137 Mon Sep 17 00:00:00 2001 From: Brian Durand Date: Fri, 27 Aug 2010 10:28:00 -0500 Subject: [PATCH] Allow arel to use tables that contain a column type that it doesn't know how to query against. --- lib/arel/engines/sql/attributes.rb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/lib/arel/engines/sql/attributes.rb b/lib/arel/engines/sql/attributes.rb index 50cc802..7027669 100644 --- a/lib/arel/engines/sql/attributes.rb +++ b/lib/arel/engines/sql/attributes.rb @@ -15,7 +15,7 @@ module Arel when :binary then String when :boolean then Boolean else - raise NotImplementedError, "Column type `#{column.type}` is not currently handled" + Undefined end end @@ -28,6 +28,11 @@ module Arel @column.type_cast(value) end + # Attribute type for column types that Arel doesn't know how to handle. + class Undefined < Arel::Attribute + include Attributes + end + %w(Boolean Decimal Float Integer String Time).each do |klass| class_eval <<-R class #{klass} < Arel::Attributes::#{klass} -- 1.6.4.1