提交 c91f4cc0 编写于 作者: V Vipul A M

Change to use a more realistic example and not giving the impression that...

Change to use a more realistic example and not giving the impression that destroy_all is preferred way to destroy related records.
This example just wants to demonstrate callback behaviour.

[ci skip]
上级 ea3b88b1
......@@ -53,9 +53,9 @@ module ActiveRecord
# end
#
# class Firm < ActiveRecord::Base
# # Destroys the associated clients and people when the firm is destroyed
# before_destroy { |record| Person.where(firm_id: record.id).destroy_all }
# before_destroy { |record| Client.where(client_of: record.id).destroy_all }
# # Disables access to the system, for associated clients and people when the firm is destroyed
# before_destroy { |record| Person.where(firm_id: record.id).update_all(access: 'disabled') }
# before_destroy { |record| Client.where(client_of: record.id).update_all(access: 'disabled') }
# end
#
# == Inheritable callback queues
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册