diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-26 13:32:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-26 13:32:25 -0700 |
commit | 3f1ab2b977d921ed7f6cd4ec2e9204b8ad22148e (patch) | |
tree | 181e0dc74c82d9d2f566978a4f33c3dc76112f1b /lib/arel/algebra/value.rb | |
parent | 87b2f70fe143ec2abab5f3831ade706b3cf8707e (diff) | |
download | rails-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.rb | 24 |
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 |