in app/controllers/api/customers_controller.rb [2:12]
def index
base =
if params[:product_id]
Product.find(params[:product_id]).customers.distinct
else
Customer.all
end
render json: base
end