Class: Decidim::ActionDelegator::Admin::PonderationForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/action_delegator/admin/ponderation_form.rb

Instance Method Summary collapse

Instance Method Details

#name_uniquenessObject



15
16
17
18
19
20
# File 'app/forms/decidim/action_delegator/admin/ponderation_form.rb', line 15

def name_uniqueness
  return unless setting
  return unless setting.ponderations.where(name: name).where.not(id: id).any?

  errors.add(:name, :taken)
end

#settingObject



22
23
24
# File 'app/forms/decidim/action_delegator/admin/ponderation_form.rb', line 22

def setting
  @setting ||= context[:setting]
end