diff --git a/app/controllers/api/v2/restful_controller.rb b/app/controllers/api/v2/restful_controller.rb index e73f21b8..de86dafd 100644 --- a/app/controllers/api/v2/restful_controller.rb +++ b/app/controllers/api/v2/restful_controller.rb @@ -147,10 +147,9 @@ module Api search_column = -> (column) { table[column].matches(safe_query) } condition = searchable_columns.reduce(nil) do |prev, column| - next search_column.(column) if prev.nil? - search_column.(column).or(prev) + next search_column.call(column) if prev.nil? + search_column.call(column).or(prev) end - puts collection.where(condition).to_sql collection.where(condition) end