@@ -8,15 +8,17 @@ class Route < ActiveRecord::Base
presence: true,
uniqueness: {case_sensitive: false}
after_update:rename_descendants
after_update:create_redirect_if_path_changed
after_update:rename_direct_descendant_routes
scope:inside_path,->(path){where('routes.path LIKE ?',"#{sanitize_sql_like(path)}/%")}
scope:direct_descendant_routes,->(path){where('routes.path LIKE ? AND routes.path NOT LIKE ?',"#{sanitize_sql_like(path)}/%","#{sanitize_sql_like(path)}/%/%")}