Skip to content

Commit 10f031f

Browse files
authored
Merge pull request rails#41992 from ashiksp/update-sti-abbreviation
[ci skip]Updated abbreviation for single table inheritance.
2 parents 0d91d4a + 8e1b191 commit 10f031f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,17 +584,17 @@ def destroy!
584584
end
585585

586586
# Returns an instance of the specified +klass+ with the attributes of the
587-
# current record. This is mostly useful in relation to single-table
588-
# inheritance structures where you want a subclass to appear as the
587+
# current record. This is mostly useful in relation to single table
588+
# inheritance (STI) structures where you want a subclass to appear as the
589589
# superclass. This can be used along with record identification in
590590
# Action Pack to allow, say, <tt>Client < Company</tt> to do something
591591
# like render <tt>partial: @client.becomes(Company)</tt> to render that
592592
# instance using the companies/company partial instead of clients/client.
593593
#
594594
# Note: The new instance will share a link to the same attributes as the original class.
595-
# Therefore the sti column value will still be the same.
595+
# Therefore the STI column value will still be the same.
596596
# Any change to the attributes on either instance will affect both instances.
597-
# If you want to change the sti column as well, use #becomes! instead.
597+
# If you want to change the STI column as well, use #becomes! instead.
598598
def becomes(klass)
599599
became = klass.allocate
600600

@@ -609,11 +609,11 @@ def becomes(klass)
609609
became
610610
end
611611

612-
# Wrapper around #becomes that also changes the instance's sti column value.
612+
# Wrapper around #becomes that also changes the instance's STI column value.
613613
# This is especially useful if you want to persist the changed class in your
614614
# database.
615615
#
616-
# Note: The old instance's sti column value will be changed too, as both objects
616+
# Note: The old instance's STI column value will be changed too, as both objects
617617
# share the same set of attributes.
618618
def becomes!(klass)
619619
became = becomes(klass)

activerecord/test/activejob/destroy_association_async_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class DestroyAssociationAsyncTest < ActiveRecord::TestCase
162162
BookDestroyAsync.delete_all
163163
end
164164

165-
test "has_many with sti parent class destroys all children class records" do
165+
test "has_many with STI parent class destroys all children class records" do
166166
book = BookDestroyAsync.create!
167167
LongEssayDestroyAsync.create!(book: book)
168168
ShortEssayDestroyAsync.create!(book: book)

0 commit comments

Comments
 (0)