diff options
author | George Claghorn <george@basecamp.com> | 2018-07-31 20:49:35 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-31 20:49:35 -0400 |
commit | 0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b (patch) | |
tree | ac5a99fd643c17f0e100496321a4b4c404e5bb11 /app | |
parent | 36b69850cc6cafa60230ca92eabb9ad93adf7e81 (diff) | |
download | rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.gz rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.bz2 rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.zip |
Prefer the ASt API
Diffstat (limited to 'app')
-rw-r--r-- | app/models/action_text/rich_text.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb index 6747def9a5..7c0fdf240d 100644 --- a/app/models/action_text/rich_text.rb +++ b/app/models/action_text/rich_text.rb @@ -2,15 +2,14 @@ class ActionText::RichText < ActiveRecord::Base self.table_name = "action_text_rich_texts" serialize :body, ActionText::Content - + belongs_to :record, polymorphic: true, touch: true has_many_attached :embeds - after_save do - self.embeds_blobs = body.attachments.map(&:attachable) + before_save do + self.embeds = body.attachments.map(&:attachable) end - def to_s body.to_s.html_safe end |