mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-10-04 01:20:43 -04:00
Added support for making items inactive
This commit is contained in:
1 parent
88b452b889
commit
30b493e2f9
3 files changed
+3
-6
No files matched your search
@@ -13,7 +13,7 @@ class ItemsController < ApplicationController
|
||||
|
||||
def autocomplete
|
||||
term = params[:q].to_s
|
||||
items = Item.where("description LIKE ?", "%#{term}%").order(:description).limit(20)
|
||||
items = Item.where("description LIKE ?", "%#{ActiveRecord::Base.sanitize_sql_like(term)}%").where(active: true).order(:description).limit(20)
|
||||
|
||||
render json: items.map { |i|
|
||||
{ id: i.id, text: i.description, price: i.unit_price }
|
||||
|
||||
Reference in new issue
Block a user