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...
You should avoid using application models in your migrations. But how else could you create records in a migration?
Requestb.in is a webservice that gives you a temporary URL you can use to test request. The page will automatically...
Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...
When an Rspec example fails, I usually investigate by running that example again using rspec . However, this does not work...
When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...
You need to set the :inverse_of option manually for relations that have an association to a polymorphic model. Otherwise...
RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...
Let's say you have a form that you render a few times but you would like to customize your...
FactoryBot allows a :class option to its factory definitions, to set the class to construct. However, this option is not...
There are many approaches out there how you can import data from a legacy application to a new application. Here...
Sometimes you add Paperclip image styles, sometimes you remove some. In order to only keep the files you actually need...
ActiveRecord::RecordNotFound errors provide quite meaningful error messages that can provide some insight on application details. Consider the following:
I needed to make sure that an element is visible and not overshadowed by an element that has a higher...