Sha256: 90fae9afde76f8eb0707770aa9825b3e7f09c606442abf8e8bcce6d2cbb13b23
Contents?: true
Size: 909 Bytes
Versions: 22
Compression:
Stored size: 909 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # Exposes the initiative type text search so users can choose a type writing its name. class InitiativesTypeScopesController < Decidim::Initiatives::ApplicationController helper_method :scoped_types # GET /initiative_type_scopes/search def search enforce_permission_to :search, :initiative_type_scope render layout: false end private def scoped_types @scoped_types ||= if initiative_type.only_global_scope_enabled? initiative_type.scopes.where(scope: nil) else initiative_type.scopes end end def initiative_type @initiative_type ||= InitiativesType.where(organization: current_organization).find(params[:type_id]) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems