fix restful controller style issuse
This commit is contained in:
parent
8255653d24
commit
c76657ecb4
1 changed files with 2 additions and 3 deletions
|
@ -147,10 +147,9 @@ module Api
|
||||||
search_column = -> (column) { table[column].matches(safe_query) }
|
search_column = -> (column) { table[column].matches(safe_query) }
|
||||||
|
|
||||||
condition = searchable_columns.reduce(nil) do |prev, column|
|
condition = searchable_columns.reduce(nil) do |prev, column|
|
||||||
next search_column.(column) if prev.nil?
|
next search_column.call(column) if prev.nil?
|
||||||
search_column.(column).or(prev)
|
search_column.call(column).or(prev)
|
||||||
end
|
end
|
||||||
puts collection.where(condition).to_sql
|
|
||||||
collection.where(condition)
|
collection.where(condition)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue