# 20210308(월)

## 2021-03-08

### 1. 학습 날짜

* 2021-03-08

### 2. 학습 시간

* 09:00 \~ 11:00

### 3. 학습 범위 및 주제

* 백본 view, model, collection
* 루비온레일즈

### 4. 학습 목표

* war-index-view 만들기

### 5. 학습 정리

* [레일즈 모델 레퍼런스를 다른 이름으로 설정](https://simian114.gitbook.io/blog/undefined/rubyonrails/undefined-7/undefined)
* [valid 체크가 create 만이 아니라 update 에서도 발생한다](https://simian114.gitbook.io/blog/undefined/rubyonrails/validation-1/validation-save-update-create)

### 6. 상세 학습 내용

* 워인덱스 페이지를 작성했다. 흠... 특별히 학습한거라고는 거의 없는것같다.
* 우리의 서비스에는 **guild\_invitation** 이라는 모델이 있다. 그리고 이 모델에는 레퍼런스로 2명의 유저가 다른이름으로 매달려 있다.
* 유저 두명은 user 와 invited\_user 라는 이름으로 존재한다. 그리고 user 는 has\_many를 통해 guild\_invitation 를 갖는다.
* 따라서 user.guild\_invitation 을 하면 곧장 guild\_invitation 이 나올것이라고 생각했는데, 어라? 나오지 않는다.
* 이 이유는 guild\_invitation 에 있었다. 해당 모델파일의 associtation 설정을 보면 `belongs_to :invited_user, class_name: "User"` 처럼 되어있는걸 확인할 수 있다.
* user에 분명 guild\_invitation 이 메달려 있지만, 그 이름은 `:invited_user` 라는 것.
* 따라서 길드 초대를 한 사람은 자신이 보낸 길드 초대장을 보지 못한다!!!

### 7. 오늘 학습 내용에 대한 개인적인 총평

* 얼릉 끝내고 싶다\~

### 8. 다음 학습 계획

* war\_request\_create PR 마무리, guild\_invitation 마무리
* war\_index 페이지 PR


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simian114.gitbook.io/blog/undefined-1/diary/2021/march/20210308.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
