Class: AppealSubmissionUpload
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- AppealSubmissionUpload
- Defined in:
- app/models/appeal_submission_upload.rb
Constant Summary collapse
- MASK_REGEX =
Matches all characters except first 3 characters, last 6 characters (2 + .pdf extension), underscores, and hyphens
/(?<=.{3})[^_-](?=.{6})/
Instance Method Summary collapse
Methods inherited from ApplicationRecord
descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?
Instance Method Details
#masked_attachment_filename ⇒ Object
18 19 20 21 22 23 |
# File 'app/models/appeal_submission_upload.rb', line 18 def filename = JSON.parse(&.file_data || '{}')['filename'] raise 'Filename for AppealSubmissionUpload not found' if filename.nil? filename.gsub(MASK_REGEX, 'X') end |