Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
Jay の宿題記法を Rask に移植した.
Rask で文書を作成する際,宿題記法が存在すれば,宿題記法にユニークな task_id (宿題記法をタスクを結びつける id) を追加しタスク作成のリンクを埋め込む.また,文書閲覧の際,宿題記法に対応するタスクが存在する場合はタスク詳細画面へのリンクを埋め込む.
宿題記法を用いた文書作成の例として,「新しい機能を付け足す.-->(向原)」という記述があれば「新しい機能を付け足す.-->(向原 !1)」のように宿題記法を書き換え,リンクを埋め込む.
やったこと
文書の controller の修正
文書作成の際,宿題記法が存在すれば ActionItem テーブルのレコードを作成し,その主キーを追加して宿題記法を上書きする.
文書の view の修正
宿題記法が存在すると,宿題記法中の ActonItem の主キーを用いて対応するタスクの存在を確認し,存在すればタスク詳細画面へのリンク,存在しなければタスク作成画面へのリンクを埋め込む.後者の際,ActionItem の主キーを含む文字列をクエリパラメータとしてリンクに追加する.
タスクの controller の修正
クエリパラメータとして受け取った文字列を作成するタスクの description フィールド (タスクの説明) に埋め込む.タスクを作成する際に description フィールドに ActionItem の主キーが含まれている場合は,主キーに対応するレコードの task_id に作成したタスクの主キーを追加する.