Sha256: 822a46ad04d8f513ff5698d41b6c2592186d362682354de271305a16ce68e39a

Contents?: true

Size: 507 Bytes

Versions: 4

Compression:

Stored size: 507 Bytes

Contents

module Comee
  module Core
    class ProductsController < ApplicationController
      include Common

      def index
        super do
          products = Comee::Core::Product.all
          products = products.where(ancestry: nil) if params[:root_only].present?
          products.then(&paginate)
        end
      end

      private

      def model_params
        params.required(:payload).permit(:code, :name, :description, :product_type_id, :unit_id, :metadata, :parent_id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
comee_core-0.1.40 app/controllers/comee/core/products_controller.rb
comee_core-0.1.39 app/controllers/comee/core/products_controller.rb
comee_core-0.1.38 app/controllers/comee/core/products_controller.rb
comee_core-0.1.37 app/controllers/comee/core/products_controller.rb