Skip to content
Snippets Groups Projects
Commit 379b3bc4 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

wip

parent 6101c15b
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,7 @@ class Communication::Block < ApplicationRecord
scope :published, -> { where(published: true) }
after_save :touch_about
before_save :attach_template_blobs
# When we set data from json, we pass it to the template.
......@@ -87,6 +88,10 @@ class Communication::Block < ApplicationRecord
template.dependencies
end
def references
[about]
end
def last_ordered_element
about.blocks.ordered.last
end
......@@ -133,6 +138,10 @@ class Communication::Block < ApplicationRecord
"Communication::Block::Template::#{template_kind.classify}".constantize
end
def touch_about
about.touch!
end
# FIXME @sebou
# Could not find or build blob: expected attachable, got #<ActiveStorage::Blob id: "f4c78657-5062-416b-806f-0b80fb66f9cd", key: "gri33wtop0igur8w3a646llel3sd", filename: "logo.svg", content_type: "image/svg+xml", metadata: {"identified"=>true, "width"=>709, "height"=>137, "analyzed"=>true}, service_name: "scaleway", byte_size: 4137, checksum: "aZqqTYabP5+72ZeddcZ/2Q==", created_at: "2022-05-05 12:17:33.941505000 +0200", university_id: "ebf2d273-ffc9-4d9f-a4ee-a2146913d617">
def attach_template_blobs
......
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