faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
loedn has joined #amber
loedn has quit [Client Quit]
<FromGitter> <damianham> You still need to add some handling in the controller, either for a foreign key constraint exception or testing the existence of a foreign key. What I like about FKCs is that you tend to catch errors during development rather than your users catching them in production because you should *never* insert a record that violates a FKC which leads to defensive programming. Furthermore coupled with ON DELETE CASCADE
<FromGitter> ... you are assured of database integrity, well as much as you can be anyway.
feepbot has quit [Ping timeout: 245 seconds]
feepbot has joined #amber
<FromGitter> <Blacksmoke16> i mean i still have FKs defined in the schema, but i dont have to explicitly watch for exceptions because they wont happen because of that check
<FromGitter> <Blacksmoke16> i usually soft delete everything
<FromGitter> <Blacksmoke16> its no diff than doing the same thing inside the controller
<FromGitter> <Blacksmoke16> but this way there is no boilerplate and you just have to throw a single annotation on the field you want to check
<FromGitter> <Blacksmoke16> basically abstracts your model validations to the deserialization step, so when it gets to your controller you dont have any/as much to do