moved new operator to own ones

pull/6827/head
Markus Kahl 14 years ago
parent 9eba26b50f
commit 372b3ac2b2
  1. 20
      lib/report/operator.rb

@ -88,16 +88,6 @@ class Report::Operator
end
end
new "?=", :label => :label_null_or_equal do
def modify(query, field, *values)
where_clause = "(#{field} IS NULL"
where_clause += " OR #{field} IN #{collection(*values)}" unless values.compact.empty?
where_clause += ")"
query.where where_clause
query
end
end
new "~", :arity => 1, :label => :label_contains do
def modify(query, field, *values)
value = values.first || ''
@ -184,6 +174,16 @@ class Report::Operator
end
end
new "?=", :label => :label_null_or_equal do
def modify(query, field, *values)
where_clause = "(#{field} IS NULL"
where_clause += " OR #{field} IN #{collection(*values)}" unless values.compact.empty?
where_clause += ")"
query.where where_clause
query
end
end
end
#############################################################################################

Loading…
Cancel
Save