mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:21:12 +08:00
add permalinks route constraint
This commit is contained in:
7
lib/permalink_constraint.rb
Normal file
7
lib/permalink_constraint.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class PermalinkConstraint
|
||||
|
||||
def matches?(request)
|
||||
Permalink.where(url: request.fullpath[1..-1]).exists?
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user