aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-12-03 17:31:25 +0100
committerYves Senn <yves.senn@gmail.com>2014-12-03 17:31:25 +0100
commit6613716ad7d6fe68dc65dff52694e2d5e72ca2fc (patch)
treeb9857fe972278d4babaf0622eedd60a5cdd61e75 /activerecord/lib/active_record/persistence.rb
parent497544f0b3eba83c1385579de50a3d521188e448 (diff)
downloadrails-6613716ad7d6fe68dc65dff52694e2d5e72ca2fc.tar.gz
rails-6613716ad7d6fe68dc65dff52694e2d5e72ca2fc.tar.bz2
rails-6613716ad7d6fe68dc65dff52694e2d5e72ca2fc.zip
document that `.delete` does work on `#readonly?` records. Closes #11860
[ci skip] This is due to the fact that `.delete` is directly translated to SQL. It tries to follow the same rules as `.delete_all` which is not able to verify that records are `#readonly?`.
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 99e104598b..1fc82f05d4 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -149,6 +149,8 @@ module ActiveRecord
# The row is simply removed with an SQL +DELETE+ statement on the
# record's primary key, and no callbacks are executed.
#
+ # Note that this will also delete records marked as <tt>readonly?</tt>.
+ #
# To enforce the object's +before_destroy+ and +after_destroy+
# callbacks or any <tt>:dependent</tt> association
# options, use <tt>#destroy</tt>.