File: //usr/local/rvm/gems/ruby-3.0.2/doc/actiontext-6.1.4.1/ri/ActionText/Attribute/has_rich_text-i.ri
U:RDoc::AnyMethod[iI"has_rich_text:ETI"(ActionText::Attribute#has_rich_text;TF:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"Provides access to a dependent RichText model that holds the body and attachments for a single named rich text attribute. ;TI"lThis dependent attribute is lazily instantiated and will be auto-saved when it's been changed. Example:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"(class Message < ActiveRecord::Base
;TI" has_rich_text :content
;TI" end
;TI"
;TI"Amessage = Message.create!(content: "<h1>Funny times!</h1>")
;TI"message.content? #=> true
;TI"7message.content.to_s # => "<h1>Funny times!</h1>"
;TI"7message.content.to_plain_text # => "Funny times!"
;T:@format0o;
; [I"yThe dependent RichText model will also automatically process attachments links as sent via the Trix-powered editor. ;TI"SThese attachments are associated with the RichText model using Active Storage.;T@o;
; [I"VIf you wish to preload the dependent RichText model, you can use the named scope:;T@o;; [I"oMessage.all.with_rich_text_content # Avoids N+1 queries when you just want the body, not the attachments.
;TI"tMessage.all.with_rich_text_content_and_embeds # Avoids N+1 queries when you just want the body and attachments.;T;
0:
@fileI"!lib/action_text/attribute.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(name);T@%FI"Attribute;TcRDoc::NormalModule00