diff options
author | Espartaco Palma <esparta@gmail.com> | 2018-10-31 23:18:27 -0700 |
---|---|---|
committer | Espartaco Palma <esparta@gmail.com> | 2018-10-31 23:18:27 -0700 |
commit | 676b0960bc63df1a7a7fdcd87d7089a8543e12d6 (patch) | |
tree | 8fa64734f62eca45102ab7b4f3771076dcba10be /activerecord | |
parent | f98901c29004904eae6f26bf84e312ad5ecd211a (diff) | |
download | rails-676b0960bc63df1a7a7fdcd87d7089a8543e12d6.tar.gz rails-676b0960bc63df1a7a7fdcd87d7089a8543e12d6.tar.bz2 rails-676b0960bc63df1a7a7fdcd87d7089a8543e12d6.zip |
Updating sample code on ActiveRecord#before_destroy callback [ci skip]
It was executing a delete_all method with wrong parameter
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 1bffe89875..5407af85ea 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -95,7 +95,7 @@ module ActiveRecord # # private # def delete_parents - # self.class.delete_all "parent_id = #{id}" + # self.class.where(parent_id: id).delete_all # end # end # |