Setting array columns When using PostgreSQL array columns, you can set an array attribute to a value with square brackets...
In this example we assume that not only the storage gem changes but also the file structure on disc.
If validations failed for a record, and you want to find out if a specific validation failed, you can leverage...
Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...
Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a...
Google Chrome has a subtle rendering bug that hits me once in a while. It usually occurs in sliders with...
Having a unique selector for an element is useful to later select it from JavaScript or to update a fragment...
When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...
Create a user without password (recommended) Replace newuser with your desired username: mysql -uroot -p CREATE USER 'newuser'@'localhost' IDENTIFIED...
Recent Bundler (1.16.1) started complaining about missing dependencies in the Gemfile. This is due to a stricter handling of specifications...
Don't sum up columns with + in a sql-query if NULL-Values can be present. MySQL and PostgreSQL cannot...
geordi delete_dumps [directory] Recursively search for files ending in *.dump and offer to delete those. When no...
You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...
MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...
On your local system that only hosts non-critical development data and only you have access to, you can store...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
You need to update a lof gems. Make sure you don't have any version constraints in your...
Running rails server will start a local server that you can access via http://localhost:3000. When you are working...
Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'. Gem Load Error is: Incorrect MySQL client...
mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...
This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name...
TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...
This is a small example on how you can check if your Postgres index can be used by a specific...