mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Docs: in typical usage, "descendant" is the noun and "descendent" is the adjective
This commit is contained in:
@@ -5248,7 +5248,7 @@ in effect. Added :readonly finder constraint. Calling an association collectio
|
||||
end
|
||||
|
||||
This will assume that settings is a text column and will now YAMLize any object put in that attribute. You can also specify
|
||||
an optional :class_name option that'll raise an exception if a serialized object is retrieved as a descendent of a class not in
|
||||
an optional :class_name option that'll raise an exception if a serialized object is retrieved as a descendant of a class not in
|
||||
the hierarchy. Example:
|
||||
|
||||
class User < ActiveRecord::Base
|
||||
@@ -5744,7 +5744,7 @@ _Misc_
|
||||
*0.8.2*
|
||||
|
||||
* Added inheritable callback queues that can ensure that certain callback methods or inline fragments are
|
||||
run throughout the entire inheritance hierarchy. Regardless of whether a descendent overwrites the callback
|
||||
run throughout the entire inheritance hierarchy. Regardless of whether a descendant overwrites the callback
|
||||
method:
|
||||
|
||||
class Topic < ActiveRecord::Base
|
||||
|
||||
@@ -327,7 +327,7 @@ module ActiveRecord #:nodoc:
|
||||
# User.find(user.id).preferences # => { "background" => "black", "display" => large }
|
||||
#
|
||||
# You can also specify a class option as the second parameter that'll raise an exception if a serialized object is retrieved as a
|
||||
# descendent of a class not in the hierarchy. Example:
|
||||
# descendant of a class not in the hierarchy. Example:
|
||||
#
|
||||
# class User < ActiveRecord::Base
|
||||
# serialize :preferences, Hash
|
||||
@@ -2167,7 +2167,7 @@ module ActiveRecord #:nodoc:
|
||||
scoped_methods.last
|
||||
end
|
||||
|
||||
# Returns the class type of the record using the current module as a prefix. So descendents of
|
||||
# Returns the class type of the record using the current module as a prefix. So descendants of
|
||||
# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
|
||||
def compute_type(type_name)
|
||||
modularized_name = type_name_with_module(type_name)
|
||||
@@ -2880,7 +2880,7 @@ module ActiveRecord #:nodoc:
|
||||
id
|
||||
end
|
||||
|
||||
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendent.
|
||||
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendant.
|
||||
# Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to do Reply.new without having to
|
||||
# set <tt>Reply[Reply.inheritance_column] = "Reply"</tt> yourself. No such attribute would be set for objects of the
|
||||
# Message class in that example.
|
||||
|
||||
@@ -77,7 +77,7 @@ module ActiveRecord
|
||||
#
|
||||
# In that case, <tt>Reply#destroy</tt> would only run +destroy_readers+ and _not_ +destroy_author+. So, use the callback macros when
|
||||
# you want to ensure that a certain callback is called for the entire hierarchy, and use the regular overwriteable methods
|
||||
# when you want to leave it up to each descendent to decide whether they want to call +super+ and trigger the inherited callbacks.
|
||||
# when you want to leave it up to each descendant to decide whether they want to call +super+ and trigger the inherited callbacks.
|
||||
#
|
||||
# *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the callbacks before specifying the
|
||||
# associations. Otherwise, you might trigger the loading of a child before the parent has registered the callbacks and they won't
|
||||
|
||||
@@ -39,7 +39,7 @@ module ActiveRecord
|
||||
# Nested finds and calculations also work with these compositions: <tt>Shirt.red.dry_clean_only.count</tt> returns the number of garments
|
||||
# for which these criteria obtain. Similarly with <tt>Shirt.red.dry_clean_only.average(:thread_count)</tt>.
|
||||
#
|
||||
# All \scopes are available as class methods on the ActiveRecord::Base descendent upon which the \scopes were defined. But they are also available to
|
||||
# All \scopes are available as class methods on the ActiveRecord::Base descendant upon which the \scopes were defined. But they are also available to
|
||||
# <tt>has_many</tt> associations. If,
|
||||
#
|
||||
# class Person < ActiveRecord::Base
|
||||
|
||||
Reference in New Issue
Block a user