I'm trying the following query
results = Tickets.order("created_at DESC").where({
(title =~ params[:title]) &
(name =~ params[:from]) |
(problem =~ params[:includes]) &
(problem !~ params[:excludes])
})
but the following error occurs
syntax error, unexpected '}', expecting tASSOC (problem !~ params[:excludes])})
and for the other lines too
but the squeel doc says to do:
Person.where{(name =~ 'Ernie%') & (salary < 50000) | (name =~ 'Joe%') & (salary > 100000)}
ps, i've spotted it. first to spot it too gets a tick.
You have an extra set of parentheses: one immediately after "where" and one at the very end.