From fcd008f06fa4fa692c1858d9e921335790a4f014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20H=C3=A4usele?= Date: Sun, 24 May 2020 15:20:37 +0200 Subject: [PATCH] [skip-ci] Fix delegated_type examples --- activerecord/lib/active_record/delegated_type.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/delegated_type.rb b/activerecord/lib/active_record/delegated_type.rb index fb108f1958..ec7909fd88 100644 --- a/activerecord/lib/active_record/delegated_type.rb +++ b/activerecord/lib/active_record/delegated_type.rb @@ -101,14 +101,14 @@ module ActiveRecord # You create a new record that uses delegated typing by creating the delegator and delegatee at the same time, # like so: # - # Entry.create! message: Comment.new(content: "Hello!"), creator: Current.user + # Entry.create! entryable: Comment.new(content: "Hello!"), creator: Current.user # # If you need more complicated composition, or you need to perform dependent validation, you should build a factory # method or class to take care of the complicated needs. This could be as simple as: # # class Entry < ApplicationRecord # def self.create_with_comment(content, creator: Current.user) - # create! message: Comment.new(content: content), creator: creator + # create! entryable: Comment.new(content: content), creator: creator # end # end #