일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- after_save
- RUBY
- install
- after_update
- Migrate
- Visual Studio Code
- ubuntu
- 우분투 24
- change_column_null
- with_indifferent_access
- 설치
- mac
- bulma
- Orange Pi 3B
- change_column
- 이것이 자바다
- ruby #string #strip #split #gsub
- Java
- MySQL
- Kotlin
- Time.znoe.now
- Rails
- 우분투
- 오랜지파이
- Ruby on Rails
- docket
- docker
- 쿠버네티스
- 주차장 시스템
- 사용중인포트검색
- Today
- Total
목록Rails (8)
중고 신입이 개발해보기..
ChatGPT 3.5의 검색결과 루비 온 레일즈(Ruby on Rails)에서 `after_update`와 `after_save`는 두 가지 다른 콜백 메서드입니다. 이 두 메서드는 ActiveRecord 모델의 생명주기 동안 특정 시점에 코드를 실행하도록 설계되어 있습니다. 1. `after_update` 콜백: - `after_update`는 ActiveRecord 객체가 업데이트된 후에 호출됩니다. - 이 메서드는 레코드가 이미 존재하고 업데이트가 수행된 경우에만 호출됩니다. - 레코드가 처음 생성될 때는 `after_update`가 호출되지 않습니다. 예를 들어: class YourModel < ApplicationRecord after_update :some_method private def s..
rbenv install --list brew upgrade ruby-build rbenv install 3.2.2 rbenv local 3.2.2 gem install rails -v 7.0.4.3 rails _7.0.4.3_ new palla -d mysql 최신 버전으로 모두 설치 보았다. ㅋㅋ
time = Time.zone.now => Fri, 20 Aug 2021 03:26:04 KST +09:00 time.to_date.to_formatted_s(:number) => "20210820" time.to_datetime.to_formatted_s(:number) => "20210820032604" time.to_time.to_formatted_s(:number) => "20210820032604" Time.zone.now.strftime('%Y-%m-%d %H:%M:%S') => "2021-08-20 03:41:33" Time.zone.now.strftime("%Y%m%d") => "20210820" Time.zone.now.strftime("%H%M%S") => "034352"
column의 nullable수정하기.. 해당값이 null: false인데 이것을 null:ture로 변경하고 싶을때 change_column_null :users, :user_nick_name, true nullable이 true로 변경된다. 다음은....

github에 저장소를 하나 만든다.. $ git config --list $ git config --local user.name 'my_name' $ git config --local user.email 'my_name@email.com' $ brew uninstall postgresql $ brew cleanup $ brew install postgresql 재설치를 했다.. $ postgres -V postgres (PostgreSQL) 13.1 createuser -P -d kalvastro bahn654 Postgres를 Free로 사용할수 있다..
{ a: 1 }.with_indifferent_access['a'] # => 1 { ‘a’ => 1 }.with_indifferent_access[:a] # => 1 심블이냐... 스트링이냐. 동시에 가능하도록해준다.. apidock.com/rails/Hash/with_indifferent_access with_indifferent_access (Hash) - APIdock with_indifferent_access() public Show source def with_indifferent_access ActiveSupport::HashWithIndifferentAccess.new(self) end apidock.com blog.dizy.dev/dev/2017/12/27/with_indifferent_a..
마이그레이션 # ./bin/rails db:migrate 롤백하기 # ./bin/rails db:rollback 마이그레이션 상태 보기 #./bin/rake db:migrate:status up 20200903071549 ********** NO FILE ********** up 20200903071603 ********** NO FILE ********** up 20201005053504 Create User up 20201012013519 ********** NO FILE ********** up 20201013012806 ********** NO FILE **********
모델을 만들고.. t.string token를 만들었다면 class User