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

Version Path
comee_core-0.3.60 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.59 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.58 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.57 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.56 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.55 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.54 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.53 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.51 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.50 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.49 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.48 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.47 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.46 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.45 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.44 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.43 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.42 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.41 app/controllers/comee/core/product_lookups_controller.rb
comee_core-0.3.40 app/controllers/comee/core/product_lookups_controller.rb