# 20210309(화)

## 2021-03-09

### 1. 학습 날짜

* 2021-03-09

### 2. 학습 시간

* 11:00 \~ 24:30

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

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

### 4. 학습 목표

* war-index-view 끝내기

### 5. 학습 정리

* [시드파일 valid 건너뛰기!](https://simian114.gitbook.io/blog/undefined/rubyonrails/validation-1/seeds-validation)

### 6. 상세 학습 내용

* 흠... 특별히 학습한 내용은 없다...
* 해결한 문제는 시드파일의 valid 체크 관련 부분이다.
* 일단 모델에 validate 를 설정해두면 트리거 되는 이벤트에 따라 특정 valid 가 진행된다.
* 시드파일이라고 예외는 없다. 지금까지 시드파일에서는 create 로 시드를 만들었는데, 이 때 발동되는 트리거는 create 이므로 `:on :create` 옵션이 걸려있는 ,valid 체크 함수가 실행된다.
* 이게 문제가 되는게 war를 ㅔㅌ스트하기 위한 레코드에는 과거에 만들어진 레코드가 있어야 하는데, 과거 데이터를 아예 생성하지 못하는 문제가 있었다.
* 이 문제는 **valid** 체크를 건너뛰는 옵션을 건네주면 해결된다.
* 또 문제는 valid 체크 건너뛰기 위해서는 create 가 아니라 **new 와 save** 를 이용해야했다.

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

* 흠... 너무 느린가?

### 8. 다음 학습 계획

* war index view 마무리
* war operation 시작


---

# 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/20210309.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.
