Class: Preneeds::PreneedAttachmentHash
- Defined in:
- app/models/preneeds/preneed_attachment_hash.rb
Overview
Models a BurialForm form attachment. This is the data about the actual attachment, Attachment.
Instance Attribute Summary collapse
-
#attachment_id ⇒ String
Attachment id.
-
#confirmation_code ⇒ String
Guid of uploaded attachment.
-
#name ⇒ String
Attachment file name.
Class Method Summary collapse
-
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters.
Instance Method Summary collapse
-
#get_file ⇒ CarrierWave::Storage::AWSFile, CarrierWave::SanitizedFile
The previously uploaded file.
-
#to_attachment ⇒ Preneeds::Attachment
The Attachment documented by this objects attributes.
Methods inherited from Base
Methods included from Vets::Model
#attributes, #initialize, #nested_attributes
Methods included from Vets::Attributes
Instance Attribute Details
#attachment_id ⇒ String
Returns attachment id.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 14 class PreneedAttachmentHash < Preneeds::Base attribute :confirmation_code, String attribute :attachment_id, String attribute :name, String # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[confirmation_code attachment_id name] end # @return [CarrierWave::Storage::AWSFile, CarrierWave::SanitizedFile] the previously uploaded file # def get_file ::Preneeds::PreneedAttachment.find_by(guid: confirmation_code).get_file end # @return [Preneeds::Attachment] the {Preneeds::Attachment} documented by this objects attributes # def Preneeds::Attachment.new( attachment_type: AttachmentType.new( attachment_type_id: ), file: get_file, name: ) end end |
#confirmation_code ⇒ String
Returns guid of uploaded attachment.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 14 class PreneedAttachmentHash < Preneeds::Base attribute :confirmation_code, String attribute :attachment_id, String attribute :name, String # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[confirmation_code attachment_id name] end # @return [CarrierWave::Storage::AWSFile, CarrierWave::SanitizedFile] the previously uploaded file # def get_file ::Preneeds::PreneedAttachment.find_by(guid: confirmation_code).get_file end # @return [Preneeds::Attachment] the {Preneeds::Attachment} documented by this objects attributes # def Preneeds::Attachment.new( attachment_type: AttachmentType.new( attachment_type_id: ), file: get_file, name: ) end end |
#name ⇒ String
Returns attachment file name.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 14 class PreneedAttachmentHash < Preneeds::Base attribute :confirmation_code, String attribute :attachment_id, String attribute :name, String # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[confirmation_code attachment_id name] end # @return [CarrierWave::Storage::AWSFile, CarrierWave::SanitizedFile] the previously uploaded file # def get_file ::Preneeds::PreneedAttachment.find_by(guid: confirmation_code).get_file end # @return [Preneeds::Attachment] the {Preneeds::Attachment} documented by this objects attributes # def Preneeds::Attachment.new( attachment_type: AttachmentType.new( attachment_type_id: ), file: get_file, name: ) end end |
Class Method Details
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters
21 22 23 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 21 def self.permitted_params %i[confirmation_code attachment_id name] end |
Instance Method Details
#get_file ⇒ CarrierWave::Storage::AWSFile, CarrierWave::SanitizedFile
Returns the previously uploaded file.
27 28 29 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 27 def get_file ::Preneeds::PreneedAttachment.find_by(guid: confirmation_code).get_file end |
#to_attachment ⇒ Preneeds::Attachment
Returns the Attachment documented by this objects attributes.
33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/preneed_attachment_hash.rb', line 33 def Preneeds::Attachment.new( attachment_type: AttachmentType.new( attachment_type_id: ), file: get_file, name: ) end |