aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-04-13 16:47:33 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-04-13 16:47:33 -0700
commit7daa8cc63e1966e4cf677c4162856da896965449 (patch)
tree863565daa17a31f058070b889815e78b41147086 /app
parent421b185dab403b44216147dbca4964a52241e531 (diff)
downloadrails-7daa8cc63e1966e4cf677c4162856da896965449.tar.gz
rails-7daa8cc63e1966e4cf677c4162856da896965449.tar.bz2
rails-7daa8cc63e1966e4cf677c4162856da896965449.zip
WIP
Diffstat (limited to 'app')
-rw-r--r--app/models/action_text/rich_text.rb9
1 files changed, 9 insertions, 0 deletions
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