From 39f59ab328e63b060702ed3bd9c924c3ed3970df Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Fri, 14 Jul 2023 19:02:23 -0700 Subject: [PATCH] Use the canonical-keyword when building urls --- app/furniture/journal/keyword.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/furniture/journal/keyword.rb b/app/furniture/journal/keyword.rb index 6eca9ccbf..bcfebbca8 100644 --- a/app/furniture/journal/keyword.rb +++ b/app/furniture/journal/keyword.rb @@ -16,6 +16,10 @@ def entries journal.entries.where("keywords::text[] && ARRAY[?]::text[]", [canonical_keyword] + (aliases.presence || [])) end + def to_param + canonical_keyword + end + def self.extract_and_create_from!(body) body.scan(/#(\w+)/)&.flatten&.map do |keyword| existing_keyword = search(keyword).first