diff --git a/actiontext/lib/action_text/fixture_set.rb b/actiontext/lib/action_text/fixture_set.rb index b3641f457e..4f9465f028 100644 --- a/actiontext/lib/action_text/fixture_set.rb +++ b/actiontext/lib/action_text/fixture_set.rb @@ -10,23 +10,26 @@ module ActionText # === YAML # # Like other Active Record-backed models, ActionText::RichText records inherit - # from ActiveRecord::Base instances and therefore can be populated by + # from ActiveRecord::Base instances and can therefore be populated by # fixtures. # - # Consider a hypothetical Article model class, its related fixture - # data, as well as fixture data for related ActionText::RichText records: + # Consider an Article class: # - # # app/models/article.rb # class Article < ApplicationRecord # has_rich_text :content # end # - # # tests/fixtures/articles.yml + # To declare fixture data for the related content, first declare fixture + # data for Article instances in test/fixtures/articles.yml: + # # first: # title: An Article # - # # tests/fixtures/action_text/rich_texts.yml - # first_content: + # Then declare the ActionText::RichText fixture data in + # test/fixtures/action_text/rich_texts.yml, making sure to declare + # each entry's record: key as a polymorphic relationship: + # + # first: # record: first (Article) # name: content # body: