I recently stumbled upon the Rails feature composed_of. One of our applications dealt with a lot of addresses and...
You can improve your LIKE / ILIKE search queries in PostgreSQL by adding a GIN index with an operate class ("opclass...
Recently I needed to benchmark an Active Record query for performance measurements. I wrote a small script that runs each...
testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods...
Reacting on a class getting added can be done with a mutation observer. Example: const items = document.querySelectorAll('.item') const expectedClass...
I recently stumbled over a quirk in the way Ruby handles local variables that I find somewhat dangerous. Consider:
I was recently asked to optimize the response time of a notoriously slow JSON API endpoint that was backed by...
While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...
Debouncing a method call delays its execution until after a specified time has passed. If it's called again before...
Using Capistrano, we usually have some array configurations in the config/deploy.rb file, like set :linked_files, %w[config/database.yml], so in...
ActiveModel classes have a class method .human_attribute_name. This returns a human-readable form of the attribute: Person.human_attribute...
When you mocked method calls in RSpec, they are mocked until the end of a spec, or until you explicitly...
After an upgrade to rails 7 I noticed that async reindexing jobs of Searchkick were failing for Model.reindex(mode: :async...
tl;dr Do not use the option optional on association declarations with a symbol, lambda or proc. Explanation Association declarations...
Your commit messages should include the ID of the issue your code belongs to. Our preferred syntax prefixes the issue...
This card describes four variants, that add a more intuitive workflow when working with nested attributes in Rails + Unpoly:
We are using assignable_values for managing enum values in Rails. Nevertheless Rails is adding more support for enum attributes...
Postgres works differently See PostgreSQL: Difference between text and varchar columns for PostgreSQL-specific info MySQL has 4 different column...
...HTML elements can automatically start playing when the autoplay attribute is set on them. Except for when they can not...
Why do we migrate? Due to a change in licensing, we cannot provide Elasticsearch versions >= 8.0. Version 7.17.x will...
Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...
Note Using rem only ever makes sense when the root font size is dynamic, i.e. you leave control to the...
Developing or debugging SAML functionality can be a hassle, especially when you need to go back and forth with someone...
If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...