From 6613716ad7d6fe68dc65dff52694e2d5e72ca2fc Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Wed, 3 Dec 2014 17:31:25 +0100 Subject: 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?`. --- activerecord/lib/active_record/persistence.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib') 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 readonly?. + # # To enforce the object's +before_destroy+ and +after_destroy+ # callbacks or any :dependent association # options, use #destroy. -- cgit v1.2.3