Class: Decidim::Amendment::VisibilityStepSetting

Inherits:
Object
  • Object
show all
Defined in:
app/models/decidim/amendment.rb

Overview

VisibilityStepSetting::options can be expanded via config setting.

For new options, add the missing locales in ‘decidim-core/config/locales/en.yml` and change the logic of the filtering methods in the Amendable concern to fit your needs:

  • Decidim::Amendable::only_visible_emendations_for(user, component)

  • Decidim::Amendable::amendables_and_visible_emendations_for(user, component)

  • Decidim::Amendable#visible_emendations_for(user)

Returns an Array of Arrays of translation, value: i.e. [[“All amendments are visible”, “all”], …]

Class Method Summary collapse

Class Method Details

.optionsObject



43
44
45
46
47
# File 'app/models/decidim/amendment.rb', line 43

def self.options
  Decidim.config.amendments_visibility_options.map do |option|
    [I18n.t(option, scope: "decidim.amendments.visibility_options"), option]
  end
end