1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] Enhance delegated types example & schema

Adding a bit more context to the documented examples & schema
This commit is contained in:
Ben Orozco 2021-04-19 09:29:25 -05:00
parent 2e14c53fc6
commit 85a2e5fdcc
No known key found for this signature in database
GPG key ID: CCF10E4807D46DA6

View file

@ -51,10 +51,9 @@ module ActiveRecord
# end # end
# end # end
# #
# # Schema: messages[ id, subject ] # # Schema: messages[ id, subject, body ]
# class Message < ApplicationRecord # class Message < ApplicationRecord
# include Entryable # include Entryable
# has_rich_text :content
# end # end
# #
# # Schema: comments[ id, content ] # # Schema: comments[ id, content ]
@ -76,7 +75,9 @@ module ActiveRecord
# #
# # entries/entryables/_message.html.erb # # entries/entryables/_message.html.erb
# <div class="message"> # <div class="message">
# Posted on <%= entry.created_at %> by <%= entry.creator.name %>: <%= entry.message.content %> # <div class="subject"><%= entry.message.subject %></div>
# <p><%= entry.message.body %></p>
# <i>Posted on <%= entry.created_at %> by <%= entry.creator.name %></i>
# </div> # </div>
# #
# # entries/entryables/_comment.html.erb # # entries/entryables/_comment.html.erb