Class: Decidim::InitiativesType

Inherits:
ApplicationRecord show all
Includes:
HasResourcePermission, HasUploadValidations, Traceable, TranslatableResource
Defined in:
decidim-initiatives/app/models/decidim/initiatives_type.rb

Overview

Initiative type.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasUploadValidations

#attached_uploader, #maximum_avatar_size, #maximum_upload_size

Class Method Details

.log_presenter_class_for(_log) ⇒ Object


53
54
55
# File 'decidim-initiatives/app/models/decidim/initiatives_type.rb', line 53

def self.log_presenter_class_for(_log)
  Decidim::Initiatives::AdminLog::InitiativesTypePresenter
end

Instance Method Details

#allow_resource_permissions?Boolean

Returns:

  • (Boolean)

41
42
43
# File 'decidim-initiatives/app/models/decidim/initiatives_type.rb', line 41

def allow_resource_permissions?
  true
end

#allowed_signature_types_for_initiativesObject


35
36
37
38
39
# File 'decidim-initiatives/app/models/decidim/initiatives_type.rb', line 35

def allowed_signature_types_for_initiatives
  return %w(online offline any) if any_signature_type?

  Array(signature_type.to_s)
end

#mounted_admin_engineObject


45
46
47
# File 'decidim-initiatives/app/models/decidim/initiatives_type.rb', line 45

def mounted_admin_engine
  "decidim_admin_initiatives"
end

#mounted_paramsObject


49
50
51
# File 'decidim-initiatives/app/models/decidim/initiatives_type.rb', line 49

def mounted_params
  { host: organization.host }
end