Class: Decidim::InitiativesTypeScope

Inherits:
ApplicationRecord show all
Defined in:
decidim-initiatives/app/models/decidim/initiatives_type_scope.rb

Instance Method Summary collapse

Instance Method Details

#global_scope?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'decidim-initiatives/app/models/decidim/initiatives_type_scope.rb', line 28

def global_scope?
  decidim_scopes_id.nil?
end

#scope_nameObject



32
33
34
35
36
# File 'decidim-initiatives/app/models/decidim/initiatives_type_scope.rb', line 32

def scope_name
  return { I18n.locale.to_s => I18n.t("decidim.scopes.global") } if global_scope?

  scope&.name.presence || { I18n.locale.to_s => I18n.t("decidim.initiatives.unavailable_scope") }
end