2010-08-12 17:55:31 -04:00
|
|
|
module Arel
|
|
|
|
module Attributes
|
2010-12-03 18:24:30 -05:00
|
|
|
class Attribute < Struct.new :relation, :name
|
2010-09-14 18:20:24 -04:00
|
|
|
include Arel::Expressions
|
2010-10-27 09:43:20 -04:00
|
|
|
include Arel::Predications
|
2011-04-29 13:36:22 -04:00
|
|
|
include Arel::AliasPredication
|
2011-04-28 04:11:50 -04:00
|
|
|
include Arel::OrderPredications
|
2011-01-29 01:40:39 -05:00
|
|
|
include Arel::Math
|
2011-04-25 15:12:05 -04:00
|
|
|
|
|
|
|
###
|
|
|
|
# Create a node for lowering this attribute
|
|
|
|
def lower
|
|
|
|
relation.lower self
|
|
|
|
end
|
2011-01-29 01:40:39 -05:00
|
|
|
end
|
|
|
|
|
2010-11-16 11:09:26 -05:00
|
|
|
class String < Attribute; end
|
|
|
|
class Time < Attribute; end
|
|
|
|
class Boolean < Attribute; end
|
2011-03-07 11:35:48 -05:00
|
|
|
class Decimal < Attribute; end
|
|
|
|
class Float < Attribute; end
|
|
|
|
class Integer < Attribute; end
|
2010-11-16 11:09:26 -05:00
|
|
|
class Undefined < Attribute; end
|
2010-08-12 17:55:31 -04:00
|
|
|
end
|
2010-09-07 19:37:11 -04:00
|
|
|
|
|
|
|
Attribute = Attributes::Attribute
|
2010-08-12 17:55:31 -04:00
|
|
|
end
|