-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
app/admin/target_scopes.rb
Outdated
|
||
controller do | ||
def destroy | ||
destroy_command = ::Command::Destroy::TargetScope.new(resource) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we catch possible NameError
s here and re-throw ex with more context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kowal done
No description provided.