Sha256: 5b9fd1e15466c809a7fc343499450b51a2488fc98d610c7f656b87946a532c16

Contents?: true

Size: 523 Bytes

Versions: 4

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    module Admin
      # A form object used to create a Delegation
      #
      class DelegationForm < Form
        attribute :granter_id, Integer
        attribute :grantee_id, Integer

        validates :granter_id, presence: true
        validates :grantee_id, presence: true

        def granter
          User.find_by(id: granter_id)
        end

        def grantee
          User.find_by(id: grantee_id)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-action_delegator-0.6.0 app/forms/decidim/action_delegator/admin/delegation_form.rb
decidim-action_delegator-0.5.0 app/forms/decidim/action_delegator/admin/delegation_form.rb
decidim-action_delegator-0.4.1 app/forms/decidim/action_delegator/admin/delegation_form.rb
decidim-action_delegator-0.4 app/forms/decidim/action_delegator/admin/delegation_form.rb