Context You have a column in your table that is used as an array , like this: t.string 'ids', array: true And you want to select all records that have more than N elements i...
Context You have a column in your table that is used as an array , like this: t.string 'ids', array: true And you want to select all records that have more than N elements i...
This is more like general advice, but when possible minimize dependencies. I will write the following examples with Ruby gems in mind but could be used in any other programming...
Context You have an array of hashes and want to check if all elements are satisfying a condition. TIL You might want to do this in Ruby: objects.all? { _1[:amount] > 10 } In th...
Quick tip about how to create a new rails project with a pre-release version of rails
If you update your Dockerfile to use ruby:3.0.3-alpine and notice the following error while building the image: ERROR: While executing gem ... (Gem::FilePermissionError) Y...
Working with DateTime or Time and timezones can be sometimes confusing. Here are some guidelines that I defined while working with dates/times. They are working well in Rails (...
Here is how to open rails console in safe mode on GCP k8s. First you need to list the pods: kubectl get pods | grep replace with the name of the pod that you want to connect...
I saw this discussion on HackerNews " What mental models do you use everyday?" and reading it my first thought was "wow these are some great summaries of maybe some life princip...
Using Concurrent::Promises and rescuing exceptions
You can also subscribe with RSS!