+ cond_way = [sql] + cond_way
+
+ # Matching for tags table
+ cond_rel = Array.new
+ sql = 'id IN (SELECT id FROM current_relation_tags WHERE 1=1'
+ if type
+ sql += ' AND k=?'
+ cond_rel += [type]
+ end
+ if value
+ sql += ' AND v=?'
+ cond_rel += [value]
+ end
+ sql += ')'
+ cond_rel = [sql] + cond_rel