aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/action_text/rich_text.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb
index 7c0fdf240d..445b444867 100644
--- a/app/models/action_text/rich_text.rb
+++ b/app/models/action_text/rich_text.rb
@@ -6,6 +6,8 @@ class ActionText::RichText < ActiveRecord::Base
belongs_to :record, polymorphic: true, touch: true
has_many_attached :embeds
+ validate { errors.add(:body, "is missing") if body.blank? }
+
before_save do
self.embeds = body.attachments.map(&:attachable)
end