From 7daa8cc63e1966e4cf677c4162856da896965449 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 13 Apr 2018 16:47:33 -0700 Subject: WIP --- app/models/action_text/rich_text.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/models/action_text/rich_text.rb (limited to 'app/models') diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb new file mode 100644 index 0000000000..a56a18efda --- /dev/null +++ b/app/models/action_text/rich_text.rb @@ -0,0 +1,9 @@ +class ActionText::RichText < ActiveRecord::Base + serialize :body, ActionText::Content + + has_many_attached :embeds + + after_save do + self.embeds_attachments_blobs = body.attachments.map(&:attachable) + end +end -- cgit v1.2.3