提交 3f2e83d9 编写于 作者: A Arthur Nogueira Neves

Merge pull request #22240 from resource11/resource11-patch-1

Requesting documentation update
...@@ -300,10 +300,10 @@ def association_instance_set(name, association) ...@@ -300,10 +300,10 @@ def association_instance_set(name, association)
# #
# === A word of warning # === A word of warning
# #
# Don't create associations that have the same name as instance methods of # Don't create associations that have the same name as [instance methods](http://api.rubyonrails.org/classes/ActiveRecord/Core.html) of
# ActiveRecord::Base. Since the association adds a method with that name to # <tt>ActiveRecord::Base</tt>. Since the association adds a method with that name to
# its model, it will override the inherited method and break things. # its model, using an association with the same name as one provided by <tt>ActiveRecord::Base</tt> will override the method inherited through <tt>ActiveRecord::Base</tt> and will break things.
# For instance, +attributes+ and +connection+ would be bad choices for association names. # For instance, +attributes+ and +connection+ would be bad choices for association names, because those names already exist in the list of <tt>ActiveRecord::Base</tt> instance methods.
# #
# == Auto-generated methods # == Auto-generated methods
# See also Instance Public methods below for more details. # See also Instance Public methods below for more details.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册