aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-26 13:36:18 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-26 13:36:18 -0700
commitc2023a2656319c509a5803c9fb71f288e713b0c9 (patch)
treeeaf3d529850b546022082c1fd4dba7d2cfee0369 /lib/arel/algebra
parent3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e (diff)
downloadrails-c2023a2656319c509a5803c9fb71f288e713b0c9.tar.gz
rails-c2023a2656319c509a5803c9fb71f288e713b0c9.tar.bz2
rails-c2023a2656319c509a5803c9fb71f288e713b0c9.zip
better organizing classes
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r--lib/arel/algebra/attributes/attribute.rb4
-rw-r--r--lib/arel/algebra/value.rb4
2 files changed, 8 insertions, 0 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