일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Orange Pi 3B
- 도커
- MySQL
- Time.znoe.now
- Java
- 오랜지파이
- after_update
- with_indifferent_access
- install
- mac
- 쿠버네티스
- after_save
- Migrate
- change_column
- 사용중인포트검색
- ubuntu
- docker
- RUBY
- Visual Studio Code
- change_column_null
- 우분투
- 우분투 24
- 이것이 자바다
- docket
- Rails
- 설치
- Ruby on Rails
- Kotlin
- ruby #string #strip #split #gsub
- 주차장 시스템
- Today
- Total
목록Back-End /Ruby On Rails (34)
중고 신입이 개발해보기..
https://blog.dizy.dev/rails/2020/11/10/rails-6-multiple-databases/ Rails 6 Multiple Databases 기능 적용하기 최근에 회사의 신규 프로젝트를 Rails 6를 업데이트했다. blog.dizy.dev ActiveRecord::Base.connected_to(role: :reading) do end

https://www.heroku.com/ Cloud Application Platform | Heroku Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud. www.heroku.com 해당 사이트가서 회원가입을 한다. https://dashboard.heroku.com/apps Heroku dashboard.heroku.com 새로운 프로젝트를 만든다.. 물론 공짜. 요즘 github에서 한개의 private를 제공하기 때문에.. github를 연동하도록한다. main branch로 푸쉬도면 자동배포가 된다. DB를 신청하지....
bin/rails db:system:change --to=postgresql 레일즈의 기본 디비를 변경해 줄 수 있다.
nil을 제일 앞으로 배치 [2, 5, 1, nil, 7, 3, nil, nil, 4, 6].sort_by { |i| [i ? 1 : 0, i] } => [nil, nil, nil, 1, 2, 3, 4, 5, 6, 7] nil을 제일 뒤로 배치 [2, 5, 1, nil, 7, 3, nil, nil, 4, 6].sort_by { |i| [i ? 0 : 1, i] } => [1, 2, 3, 4, 5, 6, 7, nil, nil, nil]
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..