diff --git a/lib/arel/engines/sql/attributes.rb b/lib/arel/engines/sql/attributes.rb index 50cc8021..7027669c 100644 --- a/lib/arel/engines/sql/attributes.rb +++ b/lib/arel/engines/sql/attributes.rb @@ -15,7 +15,7 @@ def self.for(column) 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 @@ def type_cast(value) @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}