From 85a2e5fdccfa016f17d6490987d382b082eeaeba Mon Sep 17 00:00:00 2001 From: Ben Orozco Date: Mon, 19 Apr 2021 09:29:25 -0500 Subject: [PATCH] [ci skip] Enhance delegated types example & schema Adding a bit more context to the documented examples & schema --- activerecord/lib/active_record/delegated_type.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/delegated_type.rb b/activerecord/lib/active_record/delegated_type.rb index e2609a85d4..94c6167531 100644 --- a/activerecord/lib/active_record/delegated_type.rb +++ b/activerecord/lib/active_record/delegated_type.rb @@ -51,10 +51,9 @@ module ActiveRecord # end # end # - # # Schema: messages[ id, subject ] + # # Schema: messages[ id, subject, body ] # class Message < ApplicationRecord # include Entryable - # has_rich_text :content # end # # # Schema: comments[ id, content ] @@ -76,7 +75,9 @@ module ActiveRecord # # # entries/entryables/_message.html.erb #
- # Posted on <%= entry.created_at %> by <%= entry.creator.name %>: <%= entry.message.content %> + #
<%= entry.message.subject %>
+ #

<%= entry.message.body %>

+ # Posted on <%= entry.created_at %> by <%= entry.creator.name %> #
# # # entries/entryables/_comment.html.erb