aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/value.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-26 13:32:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-26 13:32:25 -0700
commit3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e (patch)
tree181e0dc74c82d9d2f566978a4f33c3dc76112f1b /lib/arel/algebra/value.rb
parent87b2f70fe143ec2abab5f3831ade706b3cf8707e (diff)
downloadrails-3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e.tar.gz
rails-3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e.tar.bz2
rails-3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e.zip
removing more duplication
Diffstat (limited to 'lib/arel/algebra/value.rb')
-rw-r--r--lib/arel/algebra/value.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/arel/algebra/value.rb b/lib/arel/algebra/value.rb
index d9fc2e061c..90787fa5ea 100644
--- a/lib/arel/algebra/value.rb
+++ b/lib/arel/algebra/value.rb
@@ -21,5 +21,29 @@ module Arel
def to_ordering
self
end
+
+ def inclusion_predicate_sql
+ value.inclusion_predicate_sql
+ end
+
+ def exclusion_predicate_sql
+ value.exclusion_predicate_sql
+ end
+
+ def equality_predicate_sql
+ value.equality_predicate_sql
+ end
+
+ def inequality_predicate_sql
+ value.inequality_predicate_sql
+ end
+
+ def to_sql(formatter = Sql::WhereCondition.new(relation))
+ formatter.value value
+ end
+
+ def format(object)
+ object.to_sql(Sql::Value.new(relation))
+ end
end
end