activerecord-firewall icon indicating copy to clipboard operation
activerecord-firewall copied to clipboard

Add a 'report only' feature where activerecord models will not blow up when firewalled but will just log

Open JackMc opened this issue 7 years ago • 2 comments

Currently, the gem will always blow up when a firewalled constraint is violated. This isn’t great for when you’re trying to implement this new safeguard in a production application.

This adds an option to firewalled_belongs_to called report_only that instead of raising the exception will print out the error message to the log at the INFO level.

I also added an “image” model & association to each user which uses the report only type of belongs to.

JackMc avatar Mar 12 '18 20:03 JackMc

This is good for review now (no longer WIP)

JackMc avatar Mar 13 '18 04:03 JackMc

I pulled the commit that had rubocop & style changes. I'll add this in a separate PR to keep the diff clear

JackMc avatar Apr 07 '19 21:04 JackMc