Sha256: 4a5ad6e9b588d080af10dc496cba1ecdc63e636f2e94f5368b69407ff71f5089
Contents?: true
Size: 988 Bytes
Versions: 3
Compression:
Stored size: 988 Bytes
Contents
module Comee module Core class ClientPricesController < ApplicationController include Common def index super do ClientPrice.includes(:client, :product, :unit, :product_lookup).all end end def fetch_for_client client = Client.find(params[:id]) client_id = client.parent_id || client.id prices = ClientPrice.includes(:client, :product, :unit, :product_lookup) .where(client_id: client_id) render_content(prices) end def filter prices = ClientPrice.includes(:client, :product, :unit, :product_lookup) .ransack(params[:q]).result render_content(prices) end private def model_params params.require(:payload).permit(:valid_from, :valid_to, :price, :product_id, :margin, :margin_type, :client_id, :previous_price, :unit_id) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems