aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/action_text/rich_text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/action_text/rich_text.rb')
-rw-r--r--app/models/action_text/rich_text.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb
index 445b444867..0b6043bd74 100644
--- a/app/models/action_text/rich_text.rb
+++ b/app/models/action_text/rich_text.rb
@@ -6,10 +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)
+ self.embeds = body.attachments.map(&:attachable) if body.present?
end
def to_s