diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel.rb | 1 | ||||
-rw-r--r-- | lib/arel/attributes/attribute.rb | 9 | ||||
-rw-r--r-- | lib/arel/nodes.rb | 1 | ||||
-rw-r--r-- | lib/arel/nodes/equality.rb | 12 |
4 files changed, 20 insertions, 3 deletions
diff --git a/lib/arel.rb b/lib/arel.rb index afab11cd91..b322e930be 100644 --- a/lib/arel.rb +++ b/lib/arel.rb @@ -1,6 +1,7 @@ require 'arel/version' require 'arel/table' require 'arel/attributes' +require 'arel/nodes' # below is deprecated require 'arel/sql/engine' diff --git a/lib/arel/attributes/attribute.rb b/lib/arel/attributes/attribute.rb index b83a32bee7..fdc64d62e0 100644 --- a/lib/arel/attributes/attribute.rb +++ b/lib/arel/attributes/attribute.rb @@ -1,13 +1,16 @@ module Arel module Attributes class Attribute < Struct.new :relation, :name, :column + def eq other + Nodes::Equality.new self, other + end end - class String < Attribute; end - class Time < Attribute; end + class String < Attribute; end + class Time < Attribute; end class Boolean < Attribute; end class Decimal < Attribute; end - class Float < Attribute; end + class Float < Attribute; end class Integer < Attribute; end end end diff --git a/lib/arel/nodes.rb b/lib/arel/nodes.rb new file mode 100644 index 0000000000..855d8cf236 --- /dev/null +++ b/lib/arel/nodes.rb @@ -0,0 +1 @@ +require 'arel/nodes/equality' diff --git a/lib/arel/nodes/equality.rb b/lib/arel/nodes/equality.rb new file mode 100644 index 0000000000..11383b1d89 --- /dev/null +++ b/lib/arel/nodes/equality.rb @@ -0,0 +1,12 @@ +module Arel + module Nodes + class Equality + attr_accessor :left, :right + + def initialize left, right + @left = left + @right = right + end + end + end +end |