Add Array of Types in a Column using Postgres and Rails

Recently I found a nice feature when defining a column on migrations, is to use array option in the creation of a column: class MyMigration < ActiveRecord::Migration[5.2] def change # Defines a column that stores an array of a type. add_column :transactions, :categories, :string, array: true, default: [] end end With this on categories you can storage an array of values, it’s useful instead of use jsonb because as json you may also need to create the key to store values (hash)....

October 14, 2019 · 1 min · Carlos Ramos

Upgrade to Latest Version on ASDF

ASDF is an incredible version manager, to install/upgrade to latest version available of an language you can do the following steps: asdf list-all <language> this show all of the versions available to install, select the latest: asdf install <language> x.y.z and edit if you have a global ~/.tool-versions to use that version everywhere: <languaje> x.y.z real example to upgrade to latest version of erlang (10/17/2019): asdf list-all erlang asdf install erlang 22....

September 17, 2019 · 1 min · Carlos Ramos