Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation error for Delegated Types in Rails Guide #48734

Merged
merged 1 commit into from Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions guides/source/association_basics.md
Expand Up @@ -2885,13 +2885,13 @@ Entry.create! entryable: Message.new(subject: "hello!")

### Adding further delegation

We can expand our `Entry` delegator and enhance further by defining `delegates` and use polymorphism to the subclasses.
We can expand our `Entry` delegator and enhance it further by defining `delegate` and using polymorphism on the subclasses.
For example, to delegate the `title` method from `Entry` to it's subclasses:

```ruby
class Entry < ApplicationRecord
delegated_type :entryable, types: %w[ Message Comment ]
delegates :title, to: :entryable
delegate :title, to: :entryable
end

class Message < ApplicationRecord
Expand Down