...very nasty fails. Below are the basic changes you need to perform and some behavior you may eventually run into when upgrading your application. This aims to save you some...

...in your uploaders... def extension_white_list %w[jpg jpeg gif png] end must become def extension_allowlist %w[ jpg jpeg png gif ] end Also, every uploader must define allowlists...

...already_read" : 0, "request_body_fully_read" : true, "request_body_type" : "NO_BODY", "response_begun" : false, "session" : { "gupid" : "18asd3ed-U4FSeggT0O", "pid" : 4273 }, "last_data_send_time" : null, tells me, that...

When loading a database dump created with pg_dump into your database, you might run into an error like

...visibilitychange event to be notified if visibility changes. This allows your background tab to become completely passive: function pulse() { // do expensive thing } let pulseInterval function schedulePulse() { if (document.hidden) { if (pulseInterval...

...your commits are the changes. Never use merge. You've found some code that belongs to an earlier commit in your feature branch If you already have a "final" (i.e...

git rebase -i master Move the fixup directly below the commit it belongs to. Change the "pick" in front of the fixup commit to "f". Don't touch...

...the "space" character class For matching whitespaces in a regular expression, the most common and best-known shorthand expression is probably \s. It matches the following whitespace characters: " " (space)

Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...

The DB schema is the most important source of truth for your application and should be very self-explanatory. If...

Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background

Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that is...

masilotti.com

...from using fixtures over FactoryBot, as fixtures load essential test data upfront at the beginning of the testsuite. Finding peace with fixtures While setting up the database upfront challenges the...

...idea of maintaining a perfectly clean database state at the beginning of each test, with some disciplined practices, handling fixtures becomes quite manageable. Let’s dive into how this works...

...no longer recommend this option. After a chrome update, the chromedriver package sometimes lags behind and is not compatible. Install via apt install chromium-chromedriver Option 3: Install via npm...

...no longer recommend this option. After a chrome update, the chromedriver package sometimes lags behind and is not compatible. There's a handy npm package. sudo npm -g install chromedriver...

makandra Curriculum

Understand how nested attributes appear in the params. See how the Rails form helpers encode the names of nested...

Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background

Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...

has_many :images, through: :album_images end # Join model class AlbumImage < ActiveRecord::Base belongs_to :album belongs_to :image end Destroying a record in this setup will only remove...

...the record itself, and leave orphaned join records behind. image = Image.last image.destroy # removes only the `image` record, # but none of the associated `album_image` join records Good

Git commits should be very deliberate, and only contain changes that you really want to be in there. In order...

makandra dev

Note netstat has mostly been superseeded by its more modern rewrite ss which nowadays comes pre-installed rather than netstat...

...Yourself (or DRY). In Ruby on Rails we keep our code DRY by sharing behavior by using inheritance, modules, traits or partials. When you reuse behavior you want to reuse...

...module that you include in the Cucumber world. This way the module's methods become available to all step definitions. Think of it as enhancing your Capybara API with app...

Ruby (business logic) HTML fragments (layouts and views) CSS/Sass/SCSS (styles) JavaScript (client-side behavior) Static media (images, fonts, videos) Except for the Ruby part, all these files are shipped...

...frees you from needing Webpack and Yarn. This is an experimental solution that could become the default in future Rails versions. It lacks any transpilation/transformation and bundling features. They reason...

mail-tester.com

You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be...

...hard to understand, the helpers available differ for different versions of Rails and the behavior is subtly different. Make sure you read and understand the API before using these...

The recommended additional setup of the spreewald gem, a useful set of cucumber steps, includes adding a file for defining...

Background information about session storage in Rails Rails has a default mechanism to store the session in the CookieStore. This...