Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the soft-delete option for models #165

Open
kaievns opened this issue Aug 8, 2016 · 3 comments
Open

Add the soft-delete option for models #165

kaievns opened this issue Aug 8, 2016 · 3 comments

Comments

@kaievns
Copy link
Contributor

kaievns commented Aug 8, 2016

As per discussion with Nath and Simon, it would be awesome to have some sort of a flag for createModel that will turn soft-delete on for specific models

@davidbanham
Copy link
Contributor

davidbanham commented Aug 17, 2016

I took a quick run at this. I moved away from the flag in createModel option because I figured the soft deletion route was kinda useless without corresponding filtering in the get methods.

Also, should the soft deletion take place within the controller or the model? The controller seemed like the more natural place.

The thing I really dislike about the current implementation, though, is that the controller methods are duplicated from the controller util lib into the actual controller template. Before this is useful those method overrides need to move into the controller util lib and the generator should just cause the softDelete: true flag to be passed.

02eeca7

@davidbanham
Copy link
Contributor

When I say "the current implementation" I mean "the thing I did in that commit"

Not my most clearly written comment :/

@kaievns
Copy link
Contributor Author

kaievns commented Aug 17, 2016

hey, thanks for the attempt. i still reckon it should be a model feature though. get, query, watch could all be patched on fly, that's why we have a model factory there in the first place.

the controller layer is always an option, but i'd rather leave it the application business logic as much as possible, if we're going to keep pushing framework features in there it will become a mess way before a single line of application code lands.

so, we should at least try hard to land it in the models layer first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants