Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

宿題記法に紐づいたタスクが削除されると,宿題記法のリンクが正常に動作しない #44

Open
mukohara opened this issue Oct 7, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mukohara
Copy link
Contributor

mukohara commented Oct 7, 2022

概要

PR #36 によるバグ

詳細

  • 宿題記法から作成したタスクを削除すると,その記法に対応する ActionItem の task_url が無効なリンクを持つ.
  • 上記により,タスク削除後に対応する宿題記法のリンク先に遷移すると ActiveRecord エラーが起こる.

原因

リンクを埋め込む際,リンクに対応するタスクの存在を確認していない.

<% if task_url != nil %>
<%= link_to matched[0], task_url.to_s %>
<% else %>
<% message = "Created from [AI#{matched[1]}](#{request.url})" %>
<%= link_to matched[0], new_task_path(desc_header: message) %>
<% end %>

@mukohara mukohara added the bug Something isn't working label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant