# 20201226(토)

## 2020-12-26

### 1. 학습 날짜

* 2020-12-26

### 2. 학습 시간

* 18:00 \~ 22:00

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

* 루비온레일즈 모델

### 4. 학습 목표

* 레일즈에서 어떻게 모델(DB)을 다루는지 학습한다.

### 5. 과제 제출

* x

### 6. 상세 학습 내용

* 모델
  * 모델을 다룬다는 것은 이전에 학습했었던 SQL을 rails에서 어떻게 다루는지에 대해 학습하는것이다
  * 따라서 기본적인 문법은 SQL의 명령어와 거의 비슷하다.
* 뷰헬퍼에서 디버깅(?) 하는 방법
  * 이전부터 디버깅을 어떻게 하는지를 몰라서, 내가 만든 코드의 결과물을 보기가 너무 힘들었었는데... 이럴 때 사용하는 함수가 존재했었다. 바로 `debug`와 `inspect`
  * `debug`는 `debug @book`와 같이 사용한다. human readable 한 결과를 출력해준다.
  * `inspect`는 모든 인스턴스가 가지고 있는 메서드다. `@book.inspect`와 같이 사용한다. 이 녀석도 debug와 마찬가지로 의미있는 정보를 개발자에게 보여준다.
  * `to_s` 메써드도 인스턴스의 정보를 출력해주는건 위와 마찬가지지만, 이 녀석은 `for end_user`이다. 그리고 위 두개는 `for developer`

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

* 요즘들어 학습에 질이 많이 떨어진 것을 느끼고 있다. 연말이라고 해서 이렇게 나태해지면 안되는데.... 다시 추스리고 열심히 해야겠다.

### 8. 다음 학습 계획

* 루비온레일즈


---

# 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/2020/12/20201226.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.
