diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-12 15:22:26 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-12 15:22:26 -0700 |
commit | 4127484bc172900f0817d6adda666a1397ff038e (patch) | |
tree | baf9b2fc45f24b48a5c03635408d1a84e20eb311 /lib/arel | |
parent | 196b4e05b7390ac31e12a17ae224b1cf35e4becd (diff) | |
download | rails-4127484bc172900f0817d6adda666a1397ff038e.tar.gz rails-4127484bc172900f0817d6adda666a1397ff038e.tar.bz2 rails-4127484bc172900f0817d6adda666a1397ff038e.zip |
adding first node
Diffstat (limited to 'lib/arel')
-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 |
3 files changed, 19 insertions, 3 deletions
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 |