From c2023a2656319c509a5803c9fb71f288e713b0c9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 26 Jul 2010 13:36:18 -0700 Subject: better organizing classes --- lib/arel/algebra/attributes/attribute.rb | 4 ++++ lib/arel/algebra/value.rb | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'lib/arel/algebra') 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 -- cgit v1.2.3