Class: Decidim::UploadValidationForm::AttachmentContextProxy

Inherits:
Object
  • Object
show all
Defined in:
decidim-core/app/forms/decidim/upload_validation_form.rb

Overview

This class provides ability to interpret the attachment context based on the details available within the context of this class. Normally the attachment context would be defined by the record to which the attachment are added to, e.g. proposals (participant contenxt) or participatory processes (admin context). Unfortunately this information is not available when the parameters are passed to the upload validation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organization, attachment_context) ⇒ AttachmentContextProxy

Returns a new instance of AttachmentContextProxy.



84
85
86
87
# File 'decidim-core/app/forms/decidim/upload_validation_form.rb', line 84

def initialize(organization, attachment_context)
  @organization = organization
  @attachment_context = attachment_context
end

Instance Attribute Details

#attachment_contextObject (readonly)

Returns the value of attribute attachment_context.



80
81
82
# File 'decidim-core/app/forms/decidim/upload_validation_form.rb', line 80

def attachment_context
  @attachment_context
end

#organizationObject (readonly)

Returns the value of attribute organization.



80
81
82
# File 'decidim-core/app/forms/decidim/upload_validation_form.rb', line 80

def organization
  @organization
end

Class Method Details

.polymorphic_nameObject



93
94
95
# File 'decidim-core/app/forms/decidim/upload_validation_form.rb', line 93

def self.polymorphic_name
  "Decidim::Organization"
end

.primary_keyObject



89
90
91
# File 'decidim-core/app/forms/decidim/upload_validation_form.rb', line 89

def self.primary_key
  :id
end