Sha256: 561d9919da08a735fa0ae49798bc43abf7bfa5dc804491286490d88738bce0d0

Contents?: true

Size: 693 Bytes

Versions: 44

Compression:

Stored size: 693 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    # This module, when injected into a controller, loads all the resources
    # to display and interact with meeting polls.
    module PollsResources
      extend ActiveSupport::Concern

      included do
        helper_method :meeting, :poll, :questionnaire
      end

      private

      def meeting
        @meeting ||= Meeting.not_hidden.where(component: current_component).find(params[:meeting_id])
      end

      def poll
        @poll ||= meeting&.poll
      end

      def questionnaire
        @questionnaire ||= Decidim::Meetings::Questionnaire.find_by(questionnaire_for: poll) if poll
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-meetings-0.29.1 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.4 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.27.9 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.29.0 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.3 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.27.8 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.29.0.rc4 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.29.0.rc3 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.29.0.rc2 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.29.0.rc1 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.2 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.27.7 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.1 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.27.6 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.26.10 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.26.9 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.0 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.27.5 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.0.rc5 app/controllers/concerns/decidim/meetings/polls_resources.rb
decidim-meetings-0.28.0.rc4 app/controllers/concerns/decidim/meetings/polls_resources.rb