Skip to content

Commit

Permalink
Use the canonical-keyword when building urls
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Jul 20, 2023
1 parent 07e1562 commit 39f59ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/furniture/journal/keyword.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39f59ab

Please sign in to comment.