Closed pupudesu closed 5 months ago
When I was an intern, I was told to create a new model. I had to annotate the new model and wanted to use the annotate_models gem. At that time, I didn't know how to use it, so I checked their github page.
After checking out their Usage section, I figured that I can use the annotate --models
command.
I tried using it and it annotated not only the model I made, but also rewrote other models annotations. I was confused because I didn't touch other models, then I realized that the other model annotations were not up to date. This is an issue for sure, but I didn't want to include these changes in my pull request because it's out of scope.
I wondered if there is a way to annotate a specific file, just like how rspec is capable of running a specific test by adding file name after the command, so I tried searching some relevant keywords in the readme page, but I couldn't find anything.
I then checked if it's listed in issues and found a pretty similar problem.
Thinking that it's probably similar to rspec, I then tried this command:
annotate --models <model_file_path>
With this command, I got the annotation done only to that model, factory, and spec files.
Since this is what the issue author probably wants to do, I wrote a comment there.
I then checked the readme to see whether it's mentioned. I saw that although there is no singe model command example, it is mentioned in Options that it's doable.
However, I think this is hard to notice especially as a beginner, so I thought it would be nice to have it specifically explained as an example in the readme.
- READMEにexampleを追加するPRを作ってみるとよさそう!
- 足りない機能について機能リクエストするissueを作るのもいいかも!
さっき相談した時もそういうアドバイスもらったので、今からやろうと思ってます!
To submit a pull request, I checked the readme to see if there is any guideline on how to do it, but I couldn't find anything. I then checked how the other pull requests were done as a reference.
From there, I saw that other people forked the repository and submitted their pull request from their own branch.
Based on that, I submitted a pull request to include the single model use case.
おつかれさまでした!
ワークショップの終了にともないissueを閉じますが、このまま作業メモとして使っても構いません :ok_hand:
ワークショップの感想を集めています!
ブログなどに書かれた際は、このページへリンクの追加をお願いします :pray:
またの参加をお待ちしています!
This is a work log of a "OSS Gate workshop". "OSS Gate workshop" is an activity to increase OSS developers. Here's been discussed in Japanese. Thanks.
作業ログ作成時の説明
以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。
タイトル例↓:
OSS Gateワークショップ関連情報