fix :name in predicates

This commit is contained in:
Ilion Beyst 2015-09-11 10:46:03 +02:00
parent e621f6ef29
commit fcb11bb036

View file

@ -34,19 +34,19 @@ class DataTable
def range_predicates name
col = @params[:columns][name]
[
(@table[:name].gteq(col[:lower]) if col[:lower]),
(@table[:name].lteq(col[:upper]) if col[:upper])
(@table[name].gteq(col[:lower]) if col[:lower]),
(@table[name].lteq(col[:upper]) if col[:upper])
]
end
def eq_predicate name
value = @params[:columns][:name][:value]
@table[:name].eq(value) if value
value = @params[:columns][name][:value]
@table[name].eq(value) if value
end
def like_predicate name
value = @params[:columns][:name][:value]
@table[:name].matches("%#{value}%") if value
value = @params[:columns][name][:value]
@table[name].matches("%#{value}%") if value
end
private