diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-26 13:36:18 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-26 13:36:18 -0700 |
commit | c2023a2656319c509a5803c9fb71f288e713b0c9 (patch) | |
tree | eaf3d529850b546022082c1fd4dba7d2cfee0369 /lib | |
parent | 3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e (diff) | |
download | rails-c2023a2656319c509a5803c9fb71f288e713b0c9.tar.gz rails-c2023a2656319c509a5803c9fb71f288e713b0c9.tar.bz2 rails-c2023a2656319c509a5803c9fb71f288e713b0c9.zip |
better organizing classes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/algebra/attributes/attribute.rb | 4 | ||||
-rw-r--r-- | lib/arel/algebra/value.rb | 4 | ||||
-rw-r--r-- | lib/arel/engines/memory.rb | 1 | ||||
-rw-r--r-- | lib/arel/engines/memory/primitives.rb | 13 |
4 files changed, 8 insertions, 14 deletions
diff --git a/lib/arel/algebra/attributes/attribute.rb b/lib/arel/algebra/attributes/attribute.rb index 8a7993f284..0ad9382a52 100644 --- a/lib/arel/algebra/attributes/attribute.rb +++ b/lib/arel/algebra/attributes/attribute.rb @@ -27,6 +27,10 @@ module Arel false end + def eval(row) + row[self] + end + module Transformations def self.included(klass) klass.send :alias_method, :eql?, :== diff --git a/lib/arel/algebra/value.rb b/lib/arel/algebra/value.rb index 90787fa5ea..70e94e0ad0 100644 --- a/lib/arel/algebra/value.rb +++ b/lib/arel/algebra/value.rb @@ -14,6 +14,10 @@ module Arel relation == other.relation end + def eval(row) + value + end + def bind(relation) Value.new(value, relation) end diff --git a/lib/arel/engines/memory.rb b/lib/arel/engines/memory.rb index 5a963e8ba1..c0fdf6c5d6 100644 --- a/lib/arel/engines/memory.rb +++ b/lib/arel/engines/memory.rb @@ -1,3 +1,2 @@ require 'arel/engines/memory/relations' -require 'arel/engines/memory/primitives' require 'arel/engines/memory/engine' diff --git a/lib/arel/engines/memory/primitives.rb b/lib/arel/engines/memory/primitives.rb deleted file mode 100644 index 0c9471fb49..0000000000 --- a/lib/arel/engines/memory/primitives.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Arel - class Attribute - def eval(row) - row[self] - end - end - - class Value - def eval(row) - value - end - end -end |