File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,16 @@ class RichText < Record
39
39
serialize :body , coder : ActionText ::Content
40
40
delegate :to_s , :nil? , to : :body
41
41
42
+ ##
43
+ # :method: record
44
+ #
45
+ # Returns the associated record.
42
46
belongs_to :record , polymorphic : true , touch : true
47
+
48
+ ##
49
+ # :method: embeds
50
+ #
51
+ # Returns the <tt>ActiveStorage::Blob</tt>s of the embedded files.
43
52
has_many_attached :embeds
44
53
45
54
before_save do
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ def with_all_rich_text
76
76
includes ( rich_text_association_names )
77
77
end
78
78
79
+ # Returns the names of all rich text associations.
79
80
def rich_text_association_names
80
81
reflect_on_all_associations ( :has_one ) . collect ( &:name ) . select { |n | n . start_with? ( "rich_text_" ) }
81
82
end
You can’t perform that action at this time.
0 commit comments