FEATURE: Can edit category/host relationships for embedding#10
FEATURE: Can edit category/host relationships for embedding#10ShashankFC wants to merge 1 commit into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1c69189f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| records.each do |h| | ||
| execute "INSERT INTO embeddable_hosts (host, category_id, created_at, updated_at) VALUES ('#{h}', #{category_id}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)" |
There was a problem hiding this comment.
Normalize legacy hosts before inserting into embeddable_hosts
This migration inserts each legacy embeddable_hosts entry verbatim (e.g., values like http://example.com or https://example.com/path). The new lookup path (EmbeddableHost.record_for_host in app/models/embeddable_host.rb) extracts just the hostname from a URL and compares it to embeddable_hosts.host. If the stored value still includes scheme or path, record_for_host will never match, so previously-allowed hosts stop working immediately after the migration unless an admin re-saves them. Consider stripping scheme/path during the insert (or reusing the model’s normalization) so existing settings continue to authorize embeds.
Useful? React with 👍 / 👎.
Test 10
Replicated from ai-code-review-evaluation/discourse-cursor#10