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

Feature/target soft delete #65

Merged
merged 5 commits into from Sep 23, 2019
Merged

Conversation

agwozdowski
Copy link
Contributor

No description provided.


controller do
def destroy
destroy_command = ::Command::Destroy::TargetScope.new(resource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth to extract this whole action to some module (parametrized with resource class). It looks like it won't change much anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kowal added DiscardableController. Also moved DiscardableModel to concerns. Take a look please

# Redirect to resource list with proper message
def destroy
entity_name = ActiveSupport::Inflector.singularize(controller_name).camelize
entity_destroy_class = "::Command::Destroy::#{entity_name}".constantize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we catch possible NameErrors here and re-throw ex with more context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kowal done

@agwozdowski agwozdowski merged commit 8c98589 into develop Sep 23, 2019
@agwozdowski agwozdowski deleted the feature/target-soft-delete branch September 23, 2019 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants