Sha256: ae1919dcd292d8da67fca2b24b18447de10d6accd5e436f25a0e9ac107e4a36d

Contents?: true

Size: 440 Bytes

Versions: 10

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A Helper to render scopes, including a global scope, for forms.
  module ScopesHelper
    Option = Struct.new(:id, :name)

    # Check whether the resource has a visible scope or not.
    #
    # Returns boolean.
    def has_visible_scopes?(resource)
      current_participatory_space.scopes_enabled? && current_participatory_space.scope.blank? && resource.scope.present?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-core-0.8.4 app/helpers/decidim/scopes_helper.rb
decidim-core-0.8.3 app/helpers/decidim/scopes_helper.rb
decidim-core-0.8.2 app/helpers/decidim/scopes_helper.rb
decidim-core-0.8.1 app/helpers/decidim/scopes_helper.rb
decidim-core-0.8.0 app/helpers/decidim/scopes_helper.rb
decidim-core-0.7.4 app/helpers/decidim/scopes_helper.rb
decidim-core-0.7.3 app/helpers/decidim/scopes_helper.rb
decidim-core-0.7.2 app/helpers/decidim/scopes_helper.rb
decidim-core-0.7.1 app/helpers/decidim/scopes_helper.rb
decidim-core-0.7.0 app/helpers/decidim/scopes_helper.rb