Sha256: 572bcad8ce3b66521b15196ae4b02916f904f49e6eb84114ab6ae1cc0be62af6
Contents?: true
Size: 999 Bytes
Versions: 44
Compression:
Stored size: 999 Bytes
Contents
module Comee module Core class ProductLookupsController < ApplicationController include Common def index super do ProductLookup.includes(:product).all end end def fetch_one lookup = ProductLookup.includes(:product) .find_by( itemable_id: params[:id], itemable_type: "Comee::Core::Client", product_id: fetch_one_params[:product_id] ) render_content(lookup) end def filter data = ProductLookup.includes(:product, :itemable).ransack(params[:q]).result render_content(data) end private def fetch_one_params params.permit(:product_id) end def model_params params.required(:payload).permit(:code, :itemable_id, :itemable_type, :item_description, :product_id, :aliases) end end end end
Version data entries
44 entries across 44 versions & 1 rubygems