aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_text/content.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-09-12 10:58:23 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-09-12 10:58:23 -0700
commit3431c0b3eeaf284901bd9aa4265c578207d4c820 (patch)
treebad6de7844972fa8e39666e87f875b03676dd6a3 /lib/action_text/content.rb
parent0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b (diff)
downloadrails-3431c0b3eeaf284901bd9aa4265c578207d4c820.tar.gz
rails-3431c0b3eeaf284901bd9aa4265c578207d4c820.tar.bz2
rails-3431c0b3eeaf284901bd9aa4265c578207d4c820.zip
Ensure blank rich text records aren't saved or required
Diffstat (limited to 'lib/action_text/content.rb')
-rw-r--r--lib/action_text/content.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/action_text/content.rb b/lib/action_text/content.rb
index c296896ac4..22b52cff1c 100644
--- a/lib/action_text/content.rb
+++ b/lib/action_text/content.rb
@@ -4,7 +4,7 @@ module ActionText
attr_reader :fragment
- delegate :blank?, :empty?, :html_safe, :present?, to: :to_s
+ delegate :blank?, :empty?, :html_safe, :present?, to: :to_html # Delegating to to_html to avoid including the layout
def initialize(content = nil)
@fragment = ActionText::Attachment.fragment_by_canonicalizing_attachments(content)