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 @@ -36,7 +36,16 @@ class RichText < Record
36
36
serialize :body , coder : ActionText ::Content
37
37
delegate :to_s , :nil? , to : :body
38
38
39
+ ##
40
+ # :method: record
41
+ #
42
+ # Returns the associated record.
39
43
belongs_to :record , polymorphic : true , touch : true
44
+
45
+ ##
46
+ # :method: embeds
47
+ #
48
+ # Returns the <tt>ActiveStorage::Blob</tt>s of the embedded files.
40
49
has_many_attached :embeds
41
50
42
51
before_save do
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ def with_all_rich_text
68
68
eager_load ( rich_text_association_names )
69
69
end
70
70
71
+ # Returns the names of all rich text associations.
71
72
def rich_text_association_names
72
73
reflect_on_all_associations ( :has_one ) . collect ( &:name ) . select { |n | n . start_with? ( "rich_text_" ) }
73
74
end
You can’t perform that action at this time.
0 commit comments