Skip to content
Snippets Groups Projects
Unverified Commit a5d8e093 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix

parent 4c9412f4
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,10 @@ Rails.application.config.to_prepare do
# Hook ActiveStorage::Attachment to add brand_id to attachments records
ActiveStorage::Attachment.class_eval do
after_save :denormalize_university_id_for_blob, unless: :university_id
after_save :denormalize_university_id_for_blob
def denormalize_university_id_for_blob
return unless self.blob.university_id.present?
university_id = case self.record.class.name
when 'University'
self.record.id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment