Skip to content

Commit

Permalink
Allow arel to use tables that contain a column type that it doesn't k…
Browse files Browse the repository at this point in the history
…now how to query against.
  • Loading branch information
Brian Durand authored and tenderlove committed Aug 28, 2010
1 parent be7e662 commit 33445ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/arel/engines/sql/attributes.rb
Expand Up @@ -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

Expand All @@ -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}
Expand Down

0 comments on commit 33445ba

Please sign in to comment.