Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
誰が特定のレコードを削除しようとしているのかを突き止めようとしています。削除を妨げている before_destroy コールバックが配置されていますが、今は誰がそれを行っているのかを突き止めようとしています。
私はこれをお勧めします
@post.request = request
その後、あなたのpost.rb
post.rb
attr_accessor :request before_destroy :wtf private def wtf Rails.logger.warn "Person from #{request.ip} is trying to destroy, wtf!" end