A platform for community discussion. Free, open, simple.
FIX: Linking to a category via hashtag had a broken URL.
Robin Ward726d97b29deb
diff --git a/app/models/category.rb b/app/models/category.rbindex 83a842f1892..00f4e1803b7 100644--- a/app/models/category.rb+++ b/app/models/category.rb@@ -692,7 +692,7 @@ class Category < ActiveRecord::Baseenddef url_with_id- self.parent_category ? "#{url}/#{self.id}" : "#{Discourse.base_uri}/c/#{self.id}-#{self.slug}"+ self.parent_category ? "#{url}/#{self.id}" : "#{Discourse.base_uri}/c/#{self.slug}/#{self.id}"end# If the name changes, try and update the category definition topic too if it'sdiff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rbindex fa9cf430104..300fc5561e8 100644--- a/spec/models/category_spec.rb+++ b/spec/models/category_spec.rb@@ -686,7 +686,7 @@ describe Category dofab!(:category) { Fabricate(:category_with_definition, name: 'cats') }it "includes the id in the URL" do- expect(category.url_with_id).to eq("/c/#{category.id}-cats")+ expect(category.url_with_id).to eq("/c/cats/#{category.id}")endcontext "child category" do