Skip to content

Commit 35ecdef

Browse files
committed
Document some ActionText methods [ci-skip]
1 parent af2bbd5 commit 35ecdef

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

actiontext/app/models/action_text/rich_text.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ class RichText < Record
3636
serialize :body, coder: ActionText::Content
3737
delegate :to_s, :nil?, to: :body
3838

39+
##
40+
# :method: record
41+
#
42+
# Returns the associated record.
3943
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.
4049
has_many_attached :embeds
4150

4251
before_save do

actiontext/lib/action_text/attribute.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def with_all_rich_text
6868
eager_load(rich_text_association_names)
6969
end
7070

71+
# Returns the names of all rich text associations.
7172
def rich_text_association_names
7273
reflect_on_all_associations(:has_one).collect(&:name).select { |n| n.start_with?("rich_text_") }
7374
end

0 commit comments

Comments
 (0)