未验证 提交 e87ed40f 编写于 作者: B BK 提交者: Kasper Timm Hansen

Update Documentation - add method which eliminates N + 1 queries

上级 0cb6c273
......@@ -112,6 +112,15 @@ class MessagesController < ApplicationController
end
```
## Avoid N+1 queries
If you wish to preload the dependent `ActionText::RichText` model, you can use the named scope:
```ruby
Message.all.with_rich_text_content # Preload the body without attachments.
Message.all.with_rich_text_content_and_embeds # Preload both body and attachments.
```
## Custom styling
By default, the Action Text editor and content is styled by the Trix defaults.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册