Class: Decidim::ActionDelegator::Setting

Inherits:
ApplicationRecord show all
Defined in:
app/models/decidim/action_delegator/setting.rb

Overview

Contains the delegation settings of an election. Rather than a single attribute here a setting is the record itself: a bunch of configuration values.

Instance Method Summary collapse

Instance Method Details

#destroyable?Boolean

Returns:

  • (Boolean)


42
# File 'app/models/decidim/action_delegator/setting.rb', line 42

def destroyable? = participants.empty? && ponderations.empty? && delegations.empty?

#editable?Boolean

Returns:

  • (Boolean)


40
# File 'app/models/decidim/action_delegator/setting.rb', line 40

def editable? = active?

#email_required?Boolean

Returns:

  • (Boolean)


46
# File 'app/models/decidim/action_delegator/setting.rb', line 46

def email_required? = verify_with_email? || verify_with_both?

#phone_required?Boolean

Returns:

  • (Boolean)


44
# File 'app/models/decidim/action_delegator/setting.rb', line 44

def phone_required? = verify_with_phone? || verify_with_both?

#presenterObject



48
49
50
# File 'app/models/decidim/action_delegator/setting.rb', line 48

def presenter
  Decidim::ActionDelegator::SettingPresenter.new(self)
end