forked from OpenNeo/impress
implement condition negation manually, since removed from arel 2
This commit is contained in:
parent
f2c98c7697
commit
d33723aa84
1 changed files with 1 additions and 1 deletions
|
@ -262,7 +262,7 @@ class Item < ActiveRecord::Base
|
||||||
SearchFilterScopes << name.to_s
|
SearchFilterScopes << name.to_s
|
||||||
scope "search_filter_#{name}", lambda { |str, negative|
|
scope "search_filter_#{name}", lambda { |str, negative|
|
||||||
condition = yield(str)
|
condition = yield(str)
|
||||||
condition = not(condition) if negative
|
condition = "!(#{condition.to_sql})" if negative
|
||||||
rel = where(condition)
|
rel = where(condition)
|
||||||
rel = rel & args[:scope] if args[:scope]
|
rel = rel & args[:scope] if args[:scope]
|
||||||
rel
|
rel
|
||||||
|
|
Loading…
Reference in a new issue