Created
February 12, 2022 01:39
-
-
Save vinbarnes/c8dc0f3b0d7dffbbbba10a3f382b4843 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://guides.rubyonrails.org/active_record_callbacks.html#halting-execution | |
class Org < ApplicationRecord | |
before_destroy do | |
throw :abort unless no_user? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment