mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: include more details on Permalinks page
This commit is contained in:
@@ -80,6 +80,16 @@ class Permalink < ActiveRecord::Base
|
||||
return category.url if category
|
||||
nil
|
||||
end
|
||||
|
||||
def self.filter_by(url=nil)
|
||||
permalinks = Permalink
|
||||
.includes(:topic, :post, :category)
|
||||
.order('permalinks.created_at desc')
|
||||
|
||||
permalinks.where!('url ILIKE :url OR external_url ILIKE :url', url: "%#{url}%") if url.present?
|
||||
permalinks.limit!(100)
|
||||
permalinks.to_a
|
||||
end
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
||||
Reference in New Issue
Block a user