-
Notifications
You must be signed in to change notification settings - Fork 0
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
improve email: add link to the resource (admin) #31
base: release/0.26-stable
Are you sure you want to change the base?
improve email: add link to the resource (admin) #31
Conversation
antopalidi
commented
Sep 16, 2022
•
edited
Loading
edited
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.
Hi @antopalidi
this is ok, but I'd like to improve it a little.
I think this is a good oportunity to improve the ResourceLocatorPresenter
so it returns also a admin_url
.
This should be as easy as adding a new method to it:
def admin_url(options = {})
admin_member_route("url", options.merge(host: root_resource.organization.host))
end
def admin_member_route(route_type, options)
options.merge!(options_for_polymorphic)
admin_route_proxy.send("#{member_route_name}_#{route_type}", target, options)
end
In addition, check the resource_locator_presenter_spec.rb
to add a test for this method.
See the comments for additional info.
Thanks!
…n_moderated_content
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.
Great!
The only thing missing is to test for a reported resource that has no admin link. Check the notes
…oderated_content' into feat/improve_email_received_on_moderated_content