diff options
Diffstat (limited to 'app/models/redirect_route.rb')
-rw-r--r-- | app/models/redirect_route.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/redirect_route.rb b/app/models/redirect_route.rb index e36ca988701..99812bcde53 100644 --- a/app/models/redirect_route.rb +++ b/app/models/redirect_route.rb @@ -7,4 +7,6 @@ class RedirectRoute < ActiveRecord::Base length: { within: 1..255 }, presence: true, uniqueness: { case_sensitive: false } + + scope :matching_path_and_descendants, -> (path) { where('redirect_routes.path = ? OR redirect_routes.path LIKE ?', path, "#{sanitize_sql_like(path)}/%") } end |