Class: ReimbursementAttachment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ReimbursementAttachment
- Defined in:
- app/models/reimbursement_attachment.rb
Overview
Attachment for a given reimbursement
Instance Attribute Summary collapse
Belongs to collapse
-
#reimbursement ⇒ Reimbursement
The associated reimbursement.
Instance Method Summary collapse
-
#changed? ⇒ boolean
Changed is ovewritten to avoid losing the already uploaded file when saving the reimbursement fails in some very specific situations.
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes
Instance Attribute Details
#created_at ⇒ DateTime
153 |
# File 'db/schema.rb', line 153 t.datetime "created_at" |
#file ⇒ String
Validations:
10 |
# File 'app/models/reimbursement_attachment.rb', line 10 validates :reimbursement, :title, :file, presence: true |
#title ⇒ String
Validations:
10 |
# File 'app/models/reimbursement_attachment.rb', line 10 validates :reimbursement, :title, :file, presence: true |
#updated_at ⇒ DateTime
154 |
# File 'db/schema.rb', line 154 t.datetime "updated_at" |
Instance Method Details
#changed? ⇒ boolean
Changed is ovewritten to avoid losing the already uploaded file when saving the reimbursement fails in some very specific situations
20 21 22 |
# File 'app/models/reimbursement_attachment.rb', line 20 def changed? super || !file_cache.blank? end |
#reimbursement ⇒ Reimbursement
The associated reimbursement
Validations:
8 |
# File 'app/models/reimbursement_attachment.rb', line 8 belongs_to :reimbursement |