From 456aceb522879b4424c44c13f56aca4c50272dad Mon Sep 17 00:00:00 2001 From: Adam Coffman Date: Fri, 17 Jun 2022 14:39:38 -0500 Subject: [PATCH] add support for source permalink styles --- server/app/lib/link_adaptors/source.rb | 11 +++++++++++ server/app/models/frontend_router.rb | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 server/app/lib/link_adaptors/source.rb diff --git a/server/app/lib/link_adaptors/source.rb b/server/app/lib/link_adaptors/source.rb new file mode 100644 index 000000000..eb0437731 --- /dev/null +++ b/server/app/lib/link_adaptors/source.rb @@ -0,0 +1,11 @@ +module LinkAdaptors + class Source < Base + def display_name + obj.display_name + end + + def base_path + "/sources/#{obj.id}" + end + end +end diff --git a/server/app/models/frontend_router.rb b/server/app/models/frontend_router.rb index 036212315..1e813b80a 100644 --- a/server/app/models/frontend_router.rb +++ b/server/app/models/frontend_router.rb @@ -41,6 +41,8 @@ def query_info [ Drug, :id ] when /assertions?/ [ Assertion, :id ] + when /sources?/ + [ Source, :id ] when /allele_registry/ [ Variant, :allele_registry_id, ] when /id/