Sha256: d7c5bc5ee3db794018c9aa4fac1c0ec15d1beede124b2b5787afa6bf8ddd7b9c

Contents?: true

Size: 794 Bytes

Versions: 7

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Admin
    class PricesController < ResourceController
      belongs_to 'spree/product', find_by: :slug

      def index
        params[:q] ||= {}

        @search = @product.prices.accessible_by(current_ability, :index).ransack(params[:q])
        @master_prices = @search.result
          .currently_valid
          .for_master
          .order(:variant_id, :country_iso, :currency)
          .page(params[:page]).per(Spree::Config.admin_variants_per_page)
        @variant_prices = @search.result
          .currently_valid
          .for_variant
          .order(:variant_id, :country_iso, :currency)
          .page(params[:variants_page]).per(Spree::Config.admin_variants_per_page)
      end

      def edit
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_backend-3.2.5 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.4 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.3 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.2 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.1 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.0 app/controllers/spree/admin/prices_controller.rb
solidus_backend-3.2.0.alpha app/controllers/spree/admin/prices_controller.rb