blob: aeee89dc3b8271689696af21ff31d6c978d165ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
module ActiveRelation
class Value
attr_reader :value, :relation
delegate :predicate_sql, :to => :value
def initialize(value, relation)
@value, @relation = value, relation
end
def to_sql(formatter = Sql::WhereCondition.new(relation.engine))
formatter.value value
end
def format(object)
object.to_sql(Sql::Value.new(relation.engine))
end
def ==(other)
value == other.value
end
def qualify
self
end
end
end
|