Sha256: f568e4e3726c9b86c811fc4d1836a371616301a23f2a6da075d3409a1fd5e98d

Contents?: true

Size: 911 Bytes

Versions: 88

Compression:

Stored size: 911 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Sortitions
    module Admin
      # This controller is the abstract class from which all other controllers of
      # this engine inherit.
      #
      # Note that it inherits from `Decidim::Components::BaseController`, which
      # override its layout and provide all kinds of useful methods.
      class ApplicationController < Decidim::Admin::Components::BaseController
        helper_method :sortitions, :sortition

        def sortitions
          @sortitions ||= Decidim::Sortitions::FilteredSortitions
                          .for(current_component)
                          .order(created_at: :desc)
                          .page(params[:page])
                          .per(Decidim::Sortitions.items_per_page)
        end

        def sortition
          @sortition ||= sortitions.find(params[:id])
        end
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
decidim-sortitions-0.13.0 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.12.1 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.13.0.pre1 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.12.0 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.11.2 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.12.0.pre app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.11.1 app/controllers/decidim/sortitions/admin/application_controller.rb
decidim-sortitions-0.11.0.pre1 app/controllers/decidim/sortitions/admin/application_controller.rb