Class: Decidim::Amendment

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

Constant Summary collapse

STATES =
{ draft: 0, evaluating: 10, accepted: 20, rejected: 30, withdrawn: -1 }.freeze

Instance Method Summary collapse

Instance Method Details

#mapped_resource_typeString

Reports the mapped resource type for authorization transfers.

Returns:

  • (String)

    The resource type as string (i.e. its class name).



18
19
20
# File 'app/models/decidim/amendment.rb', line 18

def mapped_resource_type
  decidim_amendable_type
end

#promoted?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'app/models/decidim/amendment.rb', line 22

def promoted?
  return false unless rejected?

  emendation.linked_promoted_resource.present?
end