Sha256: 4495f458d8207db9f165ec1501fe93a65a154d43b803ef2eeab2fa279b03bd62
Contents?: true
Size: 988 Bytes
Versions: 10
Compression:
Stored size: 988 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).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
10 entries across 10 versions & 1 rubygems